Package org.hibernate.criterion
Class Order
- java.lang.Object
-
- org.hibernate.criterion.Order
-
- All Implemented Interfaces:
java.io.Serializable
public class Order extends java.lang.Object implements java.io.Serializable
Represents an ordering imposed upon the results of a Criteria- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Order(java.lang.String propertyName, boolean ascending)
Constructor for Order.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Order
asc(java.lang.String propertyName)
Ascending orderstatic Order
desc(java.lang.String propertyName)
Descending order.java.lang.String
getPropertyName()
Order
ignoreCase()
Should this ordering ignore case? Has no effect on non-character properties.boolean
isAscending()
boolean
isIgnoreCase()
Order
nulls(NullPrecedence nullPrecedence)
Defines precedence for nulls.java.lang.String
toSqlString(Criteria criteria, CriteriaQuery criteriaQuery)
Render the SQL fragmentjava.lang.String
toString()
-
-
-
Constructor Detail
-
Order
protected Order(java.lang.String propertyName, boolean ascending)
Constructor for Order. Order instances are generally created by factory methods.- See Also:
asc(java.lang.String)
,desc(java.lang.String)
-
-
Method Detail
-
asc
public static Order asc(java.lang.String propertyName)
Ascending order- Parameters:
propertyName
- The property to order on- Returns:
- The build Order instance
-
desc
public static Order desc(java.lang.String propertyName)
Descending order.- Parameters:
propertyName
- The property to order on- Returns:
- The build Order instance
-
ignoreCase
public Order ignoreCase()
Should this ordering ignore case? Has no effect on non-character properties.- Returns:
this
, for method chaining
-
nulls
public Order nulls(NullPrecedence nullPrecedence)
Defines precedence for nulls.- Parameters:
nullPrecedence
- The null precedence to use- Returns:
this
, for method chaining
-
getPropertyName
public java.lang.String getPropertyName()
-
isAscending
public boolean isAscending()
-
isIgnoreCase
public boolean isIgnoreCase()
-
toSqlString
public java.lang.String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery)
Render the SQL fragment- Parameters:
criteria
- The criteriacriteriaQuery
- The overall query- Returns:
- The ORDER BY fragment for this ordering
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-