|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.avaje.ebean.OrderBy<T>
public final class OrderBy<T>
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.
Nested Class Summary | |
---|---|
static class |
OrderBy.Property
A property and its ascending descending order. |
Constructor Summary | |
---|---|
OrderBy()
Create an empty OrderBy with no associated query. |
|
OrderBy(Query<T> query,
String orderByClause)
Construct with a given query and order by clause. |
|
OrderBy(String orderByClause)
Create an orderBy parsing the order by clause. |
Method Summary | |
---|---|
void |
add(OrderBy.Property p)
Add a property to the order by. |
Query<T> |
asc(String propertyName)
Add a property with ascending order to this OrderBy. |
OrderBy<T> |
copy()
Return a copy of the OrderBy. |
Query<T> |
desc(String propertyName)
Add a property with descending order to this OrderBy. |
boolean |
equals(Object obj)
|
List<OrderBy.Property> |
getProperties()
Return the properties for this OrderBy. |
Query<T> |
getQuery()
Return the associated query if there is one. |
int |
hash()
Return a hash value for this OrderBy. |
int |
hashCode()
|
boolean |
isEmpty()
Return true if this OrderBy does not have any properties. |
void |
reverse()
Reverse the ascending/descending order on all the properties. |
void |
setQuery(Query<T> query)
Associate this OrderBy with a query. |
String |
toString()
|
String |
toStringFormat()
Returns the OrderBy in string format. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OrderBy()
public OrderBy(String orderByClause)
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.
public OrderBy(Query<T> query, String orderByClause)
Method Detail |
---|
public void reverse()
public Query<T> asc(String propertyName)
public Query<T> desc(String propertyName)
public List<OrderBy.Property> getProperties()
public boolean isEmpty()
public Query<T> getQuery()
public void setQuery(Query<T> query)
public OrderBy<T> copy()
public void add(OrderBy.Property p)
public String toString()
toString
in class Object
public String toStringFormat()
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int hash()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |