java.lang.Object
io.ebean.OrderBy<T>
- All Implemented Interfaces:
Serializable
Represents an Order By for a Query.
Is an 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 interfaceAppend the order by clause.static classA property and its ascending descending order. -
Constructor Summary
ConstructorsConstructorDescriptionOrderBy()Deprecated, for removal: This API element is subject to removal in a future version.This method will be removed from public API.Deprecated, for removal: This API element is subject to removal in a future version.This method will be removed from public API.Deprecated, for removal: This API element is subject to removal in a future version.migrate toof(String). -
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) Deprecated, for removal: This API element is subject to removal in a future version.This method will become internal only API.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.static <P> OrderBy<P> Create an OrderBy parsing the given order by clause.voidreverse()Reverse the ascending/descending order on all the properties.voidAssociate this OrderBy with a query.toString()Returns the OrderBy in string format.
-
Constructor Details
-
OrderBy
Deprecated, for removal: This API element is subject to removal in a future version.This method will be removed from public API.Create an empty OrderBy with no associated query.
-
OrderBy
Deprecated, for removal: This API element is subject to removal in a future version.migrate toof(String). -
OrderBy
Deprecated, for removal: This API element is subject to removal in a future version.This method will be removed from public API.
-
-
Method Details
-
of
Create an OrderBy parsing the given 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.
-
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
Deprecated, for removal: This API element is subject to removal in a future version.This method will become internal only API.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.
-