java.lang.Object
io.ebean.OrderBy<T>
- All Implemented Interfaces:
Serializable
Represents an Order By for a Query.
Is a ordered list of OrderBy.Property objects each specifying a property and whether it is ascending or descending order.
Typically you will not construct an OrderBy yourself but use one that exists on the Query object.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA property and its ascending descending order. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a property to the order by.voidAdd to the order by by parsing a raw expression.Add a property with ascending order to this OrderBy.Add a property with ascending order to this OrderBy.clear()Clear the orderBy removing any current order by properties.booleancontainsProperty(String propertyName) Return true if the property is known to be contained in the order by clause.copy()Return a copy of the OrderBy.copyWithTrim(String path) Return a copy of this OrderBy with the path trimmed.Add a property with descending order to this OrderBy.Add a property with descending order to this OrderBy.booleanReturn the properties for this OrderBy.getQuery()Return the associated query if there is one.inthashCode()Return a hash value for this OrderBy.booleanisEmpty()Return true if this OrderBy does not have any properties.voidreverse()Reverse the ascending/descending order on all the properties.voidAssociate this OrderBy with a query.booleanReturn true if this order by can be used in select clause.toString()Returns the OrderBy in string format.
-
Constructor Details
-
OrderBy
public OrderBy()Create an empty OrderBy with no associated query. -
OrderBy
Create an orderBy parsing the order by clause.The order by clause follows SQL order by clause with comma's between each property and optionally "asc" or "desc" to represent ascending or descending order respectively.
-
OrderBy
Construct with a given query and order by clause.
-
-
Method Details
-
reverse
public void reverse()Reverse the ascending/descending order on all the properties. -
asc
Add a property with ascending order to this OrderBy. -
asc
Add a property with ascending order to this OrderBy. -
desc
Add a property with descending order to this OrderBy. -
desc
Add a property with descending order to this OrderBy. -
containsProperty
Return true if the property is known to be contained in the order by clause. -
copyWithTrim
Return a copy of this OrderBy with the path trimmed. -
getProperties
Return the properties for this OrderBy. -
isEmpty
public boolean isEmpty()Return true if this OrderBy does not have any properties. -
getQuery
Return the associated query if there is one. -
setQuery
Associate this OrderBy with a query. -
copy
Return a copy of the OrderBy. -
add
Add to the order by by parsing a raw expression. -
add
Add a property to the order by. -
toString
-
toStringFormat
Returns the OrderBy in string format. -
equals
-
hashCode
public int hashCode()Return a hash value for this OrderBy. This can be to determine logical equality for OrderBy clauses. -
clear
Clear the orderBy removing any current order by properties.This is intended to be used when some code creates a query with a 'default' order by clause and some other code may clear the 'default' order by clause and replace.
-
supportsSelect
public boolean supportsSelect()Return true if this order by can be used in select clause.
-