Top Description Fields Constructors Methods
org.hibernate.criterion

public Class Order

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable, java.sql.Types, java.util.Locale, org.hibernate.Criteria, .NullPrecedence, org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.type.Type

Represents an ordering imposed upon the results of a Criteria
Authors
Gavin King, Lukasz Antoniak (lukasz dot antoniak at gmail dot com)

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private NullPrecedence
private String

Constructor Summary

AccessConstructor and Description
protected
Order(String propertyName, boolean ascending)

Constructor for Order.

Method Summary

Modifier and TypeMethod and Description
public static Order

Returns:

The build Order instance
asc
(String
The property to order on
propertyName
)

Ascending order

public static Order

Returns:

The build Order instance
desc
(String
The property to order on
propertyName
)

Descending order.

public String
public Order

Returns:

this, for method chaining
ignoreCase
()

Should this ordering ignore case?

public boolean
public boolean
public Order

Returns:

this, for method chaining
nulls
(NullPrecedence
The null precedence to use
nullPrecedence
)

Defines precedence for nulls.

public String

Returns:

The ORDER BY fragment for this ordering
toSqlString
(Criteria
The criteria
criteria
,
CriteriaQuery
The overall query
criteriaQuery
)

Render the SQL fragment

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

ascendingback to summary
private boolean ascending
ignoreCaseback to summary
private boolean ignoreCase
nullPrecedenceback to summary
private NullPrecedence nullPrecedence
propertyNameback to summary
private String propertyName

Constructor Detail

Orderback to summary
protected Order(String propertyName, boolean ascending)

Constructor for Order. Order instances are generally created by factory methods.

See Also
asc, desc

Method Detail

ascback to summary
public static Order asc(String propertyName)

Ascending order

Parameters
propertyName:String

The property to order on

Returns:Order

The build Order instance

descback to summary
public static Order desc(String propertyName)

Descending order.

Parameters
propertyName:String

The property to order on

Returns:Order

The build Order instance

getPropertyNameback to summary
public String getPropertyName()
ignoreCaseback to summary
public Order ignoreCase()

Should this ordering ignore case? Has no effect on non-character properties.

Returns:Order

this, for method chaining

isAscendingback to summary
public boolean isAscending()
Annotations
@SuppressWarnings:UnusedDeclaration
isIgnoreCaseback to summary
public boolean isIgnoreCase()
Annotations
@SuppressWarnings:UnusedDeclaration
nullsback to summary
public Order nulls(NullPrecedence nullPrecedence)

Defines precedence for nulls.

Parameters
nullPrecedence:NullPrecedence

The null precedence to use

Returns:Order

this, for method chaining

toSqlStringback to summary
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery)

Render the SQL fragment

Parameters
criteria:Criteria

The criteria

criteriaQuery:CriteriaQuery

The overall query

Returns:String

The ORDER BY fragment for this ordering

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override