Package org.hibernate.query
Class Order<X>
- java.lang.Object
-
- org.hibernate.query.Order<X>
-
- Type Parameters:
X
- The result type of the query to be sorted
@Incubating public class Order<X> extends Object
A rule for sorting a query result set.This is a convenience class which allows query result ordering rules to be passed around the system before being applied to a
Query
by callingSelectionQuery.setOrder(java.util.List<org.hibernate.query.Order<? super R>>)
.A parameter of a HQL query method may be declared with type
Order<? super E>
,List<Order<? super E>>
, orOrder<? super E>...
(varargs) whereE
is the entity type returned by the query.- Since:
- 6.3
- See Also:
SelectionQuery.setOrder(Order)
,SelectionQuery.setOrder(java.util.List)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Order<Object[]>
asc(int element)
static <T> Order<T>
asc(SingularAttribute<T,?> attribute)
static <T> Order<T>
asc(Class<T> entityClass, String attributeName)
static Order<Object[]>
by(int element, SortDirection direction)
static Order<Object[]>
by(int element, SortDirection direction, NullPrecedence nullPrecedence)
static <T> Order<T>
by(SingularAttribute<T,?> attribute, SortDirection direction)
static <T> Order<T>
by(SingularAttribute<T,?> attribute, SortDirection direction, NullPrecedence nullPrecedence)
static <T> Order<T>
by(Class<T> entityClass, String attributeName, SortDirection direction)
static <T> Order<T>
by(Class<T> entityClass, String attributeName, SortDirection direction, NullPrecedence nullPrecedence)
static Order<Object[]>
desc(int element)
static <T> Order<T>
desc(SingularAttribute<T,?> attribute)
static <T> Order<T>
desc(Class<T> entityClass, String attributeName)
boolean
equals(Object o)
SingularAttribute<X,?>
getAttribute()
String
getAttributeName()
SortDirection
getDirection()
int
getElement()
Class<X>
getEntityClass()
NullPrecedence
getNullPrecedence()
int
hashCode()
String
toString()
-
-
-
Method Detail
-
asc
public static <T> Order<T> asc(SingularAttribute<T,?> attribute)
-
desc
public static <T> Order<T> desc(SingularAttribute<T,?> attribute)
-
by
public static <T> Order<T> by(SingularAttribute<T,?> attribute, SortDirection direction)
-
by
public static <T> Order<T> by(SingularAttribute<T,?> attribute, SortDirection direction, NullPrecedence nullPrecedence)
-
by
public static <T> Order<T> by(Class<T> entityClass, String attributeName, SortDirection direction)
-
by
public static <T> Order<T> by(Class<T> entityClass, String attributeName, SortDirection direction, NullPrecedence nullPrecedence)
-
by
public static Order<Object[]> by(int element, SortDirection direction)
-
by
public static Order<Object[]> by(int element, SortDirection direction, NullPrecedence nullPrecedence)
-
getDirection
public SortDirection getDirection()
-
getNullPrecedence
public NullPrecedence getNullPrecedence()
-
getAttribute
public SingularAttribute<X,?> getAttribute()
-
getAttributeName
public String getAttributeName()
-
getElement
public int getElement()
-
-