public class Sort extends Object implements Serializable
Search.Search,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected boolean |
customExpression |
protected boolean |
desc |
protected boolean |
ignoreCase |
protected String |
property |
| Constructor and Description |
|---|
Sort() |
Sort(boolean isCustomExpression,
String property)
If isCustomExpression is true, the "property" of this Sort is reckoned
as a free-form JPQL/HQL order-by expression.
|
Sort(boolean isCustomExpression,
String property,
boolean desc)
If isCustomExpression is true, the "property" of this Sort is reckoned
as a free-form JPQL/HQL order-by expression.
|
Sort(String property) |
Sort(String property,
boolean desc) |
Sort(String property,
boolean desc,
boolean ignoreCase) |
| Modifier and Type | Method and Description |
|---|---|
static Sort |
asc(String property) |
static Sort |
asc(String property,
boolean ignoreCase) |
static Sort |
customExpressionAsc(String expression)
Instead of a property for this Sort, use a free-form JPQL/HQL order-by
expression.
|
static Sort |
customExpressionDesc(String expression)
Instead of a property for this Sort, use a free-form JPQL/HQL order-by
expression.
|
static Sort |
desc(String property) |
static Sort |
desc(String property,
boolean ignoreCase) |
boolean |
equals(Object obj) |
String |
getProperty()
Property on which to sort
|
int |
hashCode() |
boolean |
isCustomExpression()
If true, the "property" of this Sort is reckoned as a free-form JPQL/HQL
order-by expression.
|
boolean |
isDesc()
If true, sort descending by the given property; otherwise, sort
ascending.
|
boolean |
isIgnoreCase()
If true the ordering will be case insensitive for this property.
|
void |
setCustomExpression(boolean customExpression)
If true, the "property" of this Sort is reckoned as a free-form JPQL/HQL
order-by expression.
|
void |
setDesc(boolean desc)
If true, sort descending by the given property; otherwise, sort
ascending.
|
void |
setIgnoreCase(boolean ignoreCase)
If true the ordering will be case insensitive for this property.
|
void |
setProperty(String property)
Property on which to sort
|
String |
toString() |
protected String property
protected boolean desc
protected boolean ignoreCase
protected boolean customExpression
public Sort()
public Sort(String property, boolean desc, boolean ignoreCase)
public Sort(String property, boolean desc)
public Sort(String property)
public Sort(boolean isCustomExpression,
String property,
boolean desc)
Here are some examples:
new Sort(true, "cast({employeeno} as integer)");
new Sort(true, "abs({prop1} - {prop2})");
public Sort(boolean isCustomExpression,
String property)
Here are some examples:
new Sort(true, "cast({employeeno} as integer)", true);
new Sort(true, "abs({prop1} - {prop2})", true);
public static Sort customExpressionAsc(String expression)
Here are some examples:
Sort.customExpressionAsc("cast({employeeno} as integer)");
Sort.customExpressionAsc("abs({prop1} - {prop2})");
public static Sort customExpressionDesc(String expression)
Here are some examples:
Sort.customExpressionDesc("cast({employeeno} as integer)");
Sort.customExpressionDesc("abs({prop1} - {prop2})");
public String getProperty()
public void setProperty(String property)
public boolean isDesc()
public void setDesc(boolean desc)
public boolean isIgnoreCase()
public void setIgnoreCase(boolean ignoreCase)
public boolean isCustomExpression()
If true, the "property" of this Sort is reckoned as a free-form JPQL/HQL order-by expression. Reference properties by wrapping them with curly braces ({}).
When set to true, the ignoreCase property
is ignored.
Here are some examples:
new Sort(true, "cast({employeeno} as integer)");
new Sort(true, "abs({prop1} - {prop2})", true);
Sort.ascCustom("cast({employeeno} as integer)");
Sort.descCustom("abs({prop1} - {prop2})");
public void setCustomExpression(boolean customExpression)
If true, the "property" of this Sort is reckoned as a free-form JPQL/HQL order-by expression. Reference properties by wrapping them with curly braces ({}).
When set to true, the ignoreCase property
is ignored.
Here are some examples:
new Sort(true, "cast({employeeno} as integer)");
new Sort(true, "abs({prop1} - {prop2})", true);
Sort.ascCustom("cast({employeeno} as integer)");
Sort.descCustom("abs({prop1} - {prop2})");
Copyright © 2008-2013. All Rights Reserved.