public class Sort
extends java.lang.Object
implements java.io.Serializable
Search
.Search
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected boolean |
customExpression |
protected boolean |
desc |
protected boolean |
ignoreCase |
protected java.lang.String |
property |
Constructor and Description |
---|
Sort() |
Sort(boolean isCustomExpression,
java.lang.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,
java.lang.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(java.lang.String property) |
Sort(java.lang.String property,
boolean desc) |
Sort(java.lang.String property,
boolean desc,
boolean ignoreCase) |
Modifier and Type | Method and Description |
---|---|
static Sort |
asc(java.lang.String property) |
static Sort |
asc(java.lang.String property,
boolean ignoreCase) |
static Sort |
customExpressionAsc(java.lang.String expression)
Instead of a property for this Sort, use a free-form JPQL/HQL order-by
expression.
|
static Sort |
customExpressionDesc(java.lang.String expression)
Instead of a property for this Sort, use a free-form JPQL/HQL order-by
expression.
|
static Sort |
desc(java.lang.String property) |
static Sort |
desc(java.lang.String property,
boolean ignoreCase) |
boolean |
equals(java.lang.Object obj) |
java.lang.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(java.lang.String property)
Property on which to sort
|
java.lang.String |
toString() |
protected java.lang.String property
protected boolean desc
protected boolean ignoreCase
protected boolean customExpression
public Sort()
public Sort(java.lang.String property, boolean desc, boolean ignoreCase)
public Sort(java.lang.String property, boolean desc)
public Sort(java.lang.String property)
public Sort(boolean isCustomExpression, java.lang.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, java.lang.String property)
Here are some examples:
new Sort(true, "cast({employeeno} as integer)", true); new Sort(true, "abs({prop1} - {prop2})", true);
public static Sort asc(java.lang.String property)
public static Sort asc(java.lang.String property, boolean ignoreCase)
public static Sort desc(java.lang.String property)
public static Sort desc(java.lang.String property, boolean ignoreCase)
public static Sort customExpressionAsc(java.lang.String expression)
Here are some examples:
Sort.customExpressionAsc("cast({employeeno} as integer)"); Sort.customExpressionAsc("abs({prop1} - {prop2})");
public static Sort customExpressionDesc(java.lang.String expression)
Here are some examples:
Sort.customExpressionDesc("cast({employeeno} as integer)"); Sort.customExpressionDesc("abs({prop1} - {prop2})");
public java.lang.String getProperty()
public void setProperty(java.lang.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})");
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object