public abstract class AbstractCriteriaBuilder extends GroovyObjectSupport implements Criteria, ProjectionList
Abstract criteria builder implementation
| Modifiers | Name | Description |
|---|---|---|
static String |
ORDER_ASCENDING |
|
static String |
ORDER_DESCENDING |
|
protected static String |
ROOT_CALL |
|
protected static String |
ROOT_DO_CALL |
|
protected static String |
SCROLL_CALL |
|
protected List<Query.Order> |
orderEntries |
|
protected boolean |
paginationEnabledList |
|
protected PersistentEntity |
persistentEntity |
|
protected ProjectionList |
projectionList |
|
protected Query |
query |
|
protected QueryCreator |
queryCreator |
|
protected MetaObjectProtocol |
queryMetaClass |
|
protected boolean |
readOnly |
|
protected Class |
targetClass |
|
protected boolean |
uniqueResult |
| Constructor and description |
|---|
AbstractCriteriaBuilder(Class targetClass, QueryCreator queryCreator, MappingContext mappingContext) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected Criterion |
addToCriteria(Criterion c)adds and returns the given criterion to the currently active criteria set. |
|
public Criteria |
allEq(Map<String, Object> propertyValues)Apply an "equals" constraint to each property in the key set of a Map |
|
public Criteria |
and(Closure callable) |
|
public ProjectionList |
avg(String name)Computes the average value of a property |
|
public Criteria |
between(String propertyName, Object start, Object finish)Restricts the results by the given property value range (inclusive) |
|
public void |
build(Closure criteria) |
|
public Criteria |
cache(boolean cache) |
|
public ProjectionList |
count()Count the number of records returned |
|
public ProjectionList |
countDistinct(String property)Projection that signifies to count distinct results |
|
public ProjectionList |
distinct()Projection that signifies to return only distinct results |
|
public ProjectionList |
distinct(String property)Projection that signifies to return only distinct results |
|
protected void |
ensureQueryIsInitialized() |
|
public Criteria |
eq(String propertyName, Object propertyValue)Creates an "equals" Criterion based on the specified property name and value. |
|
public Criteria |
eqAll(String propertyName, Closure propertyValue)Creates a subquery criterion that ensures the given property is equal to all the given returned values |
|
public Criteria |
eqAll(String propertyName, QueryableCriteria propertyValue)Creates a subquery criterion that ensures the given property is equal to all the given returned values |
|
public Criteria |
eqProperty(String propertyName, String otherPropertyName)Constraints a property to be equal to a specified other property |
|
public Criteria |
exists(QueryableCriteria<?> subquery) |
|
public Criteria |
ge(String property, Object value)Used to restrict a value to be greater than or equal to the given value |
|
public Criteria |
geAll(String propertyName, Closure propertyValue)Creates a subquery criterion that ensures the given property is greater than all the given returned values |
|
public Criteria |
geAll(String propertyName, QueryableCriteria propertyValue)Creates a subquery criterion that ensures the given property is greater than all the given returned values |
|
public Criteria |
geProperty(String propertyName, String otherPropertyName)Constraints a property to be greater than or equal to a specified other property |
|
public Criteria |
geSome(String propertyName, QueryableCriteria propertyValue) |
|
public Criteria |
geSome(String propertyName, Closure<?> propertyValue) |
|
public Query |
getQuery() |
|
public Class |
getTargetClass() |
|
public ProjectionList |
groupProperty(String property)Defines a group by projection for datastores that support it |
|
public Criteria |
gt(String property, Object value)Used to restrict a value to be greater than or equal to the given value |
|
public Criteria |
gtAll(String propertyName, Closure propertyValue)Creates a subquery criterion that ensures the given property is greater than all the given returned values |
|
public Criteria |
gtAll(String propertyName, QueryableCriteria propertyValue)Creates a subquery criterion that ensures the given property is greater than all the given returned values |
|
public Criteria |
gtProperty(String propertyName, String otherPropertyName)Constraints a property to be greater than a specified other property |
|
public Criteria |
gtSome(String propertyName, QueryableCriteria propertyValue) |
|
public Criteria |
gtSome(String propertyName, Closure<?> propertyValue) |
|
public Criteria |
gte(String property, Object value)Used to restrict a value to be greater than or equal to the given value |
|
public ProjectionList |
id() |
|
public Criteria |
idEq(Object propertyValue)Creates an "equals" Criterion based on the specified property name and value. |
|
public Criteria |
idEquals(Object value) |
|
public Criteria |
ilike(String propertyName, Object propertyValue)Creates an ilike Criterion based on the specified property name and value. |
|
public Criteria |
in(String propertyName, QueryableCriteria<?> subquery) |
|
public Criteria |
in(String propertyName, Closure<?> subquery) |
|
public Criteria |
in(String propertyName, Collection values)Creates an "in" Criterion based on the specified property name and list of values. |
|
public Criteria |
in(String propertyName, Object[] values)Creates an "in" Criterion based on the specified property name and list of values. |
|
public Criteria |
inList(String propertyName, QueryableCriteria<?> subquery) |
|
public Criteria |
inList(String propertyName, Closure<?> subquery) |
|
public Criteria |
inList(String propertyName, Collection values)Creates an "in" Criterion based on the specified property name and list of values. |
|
public Criteria |
inList(String propertyName, Object[] values)Creates an "in" Criterion based on the specified property name and list of values. |
|
protected void |
invokeClosureNode(Object args) |
|
protected Object |
invokeList() |
|
public Object |
invokeMethod(String name, Object obj) |
|
public Criteria |
isEmpty(String propertyName) |
|
public Criteria |
isNotEmpty(String propertyName) |
|
public Criteria |
isNotNull(String propertyName) |
|
public Criteria |
isNull(String propertyName) |
|
public Criteria |
join(String property) |
|
public Criteria |
le(String property, Object value)Used to restrict a value to be less than or equal to the given value |
|
public Criteria |
leAll(String propertyName, Closure propertyValue)Creates a subquery criterion that ensures the given property is less than all the given returned values |
|
public Criteria |
leAll(String propertyName, QueryableCriteria propertyValue)Creates a subquery criterion that ensures the given property is less than all the given returned values |
|
public Criteria |
leProperty(String propertyName, String otherPropertyName)Constraints a property to be less than or equal to a specified other property |
|
public Criteria |
leSome(String propertyName, QueryableCriteria propertyValue) |
|
public Criteria |
leSome(String propertyName, Closure<?> propertyValue) |
|
public Criteria |
like(String propertyName, Object propertyValue)Creates an like Criterion based on the specified property name and value. |
|
public Criteria |
lt(String property, Object value)Used to restrict a value to be less than or equal to the given value |
|
public Criteria |
ltAll(String propertyName, Closure propertyValue)Creates a subquery criterion that ensures the given property is less than all the given returned values |
|
public Criteria |
ltAll(String propertyName, QueryableCriteria propertyValue)Creates a subquery criterion that ensures the given property is less than all the given returned values |
|
public Criteria |
ltProperty(String propertyName, String otherPropertyName)Constraints a property to be less than a specified other property |
|
public Criteria |
ltSome(String propertyName, QueryableCriteria propertyValue) |
|
public Criteria |
ltSome(String propertyName, Closure<?> propertyValue) |
|
public Criteria |
lte(String property, Object value)Used to restrict a value to be less than or equal to the given value |
|
public ProjectionList |
max(String name)Computes the max value of a property |
|
public ProjectionList |
min(String name)Computes the min value of a property |
|
public Criteria |
ne(String propertyName, Object propertyValue)Creates a "not equals" Criterion based on the specified property name and value. |
|
public Criteria |
neProperty(String propertyName, String otherPropertyName)Constraints a property to be not equal to a specified other property |
|
public Criteria |
not(Closure callable) |
|
public Criteria |
notExists(QueryableCriteria<?> subquery) |
|
public Criteria |
notIn(String propertyName, QueryableCriteria<?> subquery) |
|
public Criteria |
notIn(String propertyName, Closure<?> subquery) |
|
public Criteria |
or(Closure callable) |
|
public Criteria |
order(String propertyName)Orders by the specified property name (defaults to ascending) |
|
public Criteria |
order(Order o)Orders by the specified property name (defaults to ascending) |
|
public Criteria |
order(String propertyName, String direction)Orders by the specified property name and direction |
|
public ProjectionList |
projections(Closure callable)Defines projections |
|
public ProjectionList |
property(String name)A projection that obtains the value of a property of an entity |
|
public Criteria |
readOnly(boolean readOnly) |
|
public Criteria |
rlike(String propertyName, Object propertyValue)Creates an rlike Criterion based on the specified property name and value. |
|
public ProjectionList |
rowCount()Count the number of records returned |
|
public Criteria |
select(String property) |
|
public void |
setUniqueResult(boolean uniqueResult) |
|
public Criteria |
sizeEq(String propertyName, int size) |
|
public Criteria |
sizeGe(String propertyName, int size) |
|
public Criteria |
sizeGt(String propertyName, int size) |
|
public Criteria |
sizeLe(String propertyName, int size) |
|
public Criteria |
sizeLt(String propertyName, int size) |
|
public Criteria |
sizeNe(String propertyName, int size) |
|
public ProjectionList |
sum(String name)Computes the sum of a property |
|
protected void |
validatePropertyName(String propertyName, String methodName) |
| Methods inherited from class | Name |
|---|---|
class GroovyObjectSupport |
equals, getClass, getMetaClass, getProperty, hashCode, invokeMethod, notify, notifyAll, setMetaClass, setProperty, toString, wait, wait, wait |
adds and returns the given criterion to the currently active criteria set. this might be either the root criteria or a currently open LogicalExpression.
Apply an "equals" constraint to each property in the key set of a Map
propertyValues - a map from property names to valuesComputes the average value of a property
name - The name of the propertyRestricts the results by the given property value range (inclusive)
propertyName - The property namestart - The start of the rangefinish - The end of the rangeCount the number of records returned
Projection that signifies to count distinct results
property - The name of the propertyProjection that signifies to return only distinct results
Projection that signifies to return only distinct results
property - The name of the propertyCreates an "equals" Criterion based on the specified property name and value.
propertyName - The property namepropertyValue - The property valueCreates a subquery criterion that ensures the given property is equal to all the given returned values
propertyName - The property namepropertyValue - The property valueCreates a subquery criterion that ensures the given property is equal to all the given returned values
propertyName - The property namepropertyValue - The property valueConstraints a property to be equal to a specified other property
propertyName - The propertyotherPropertyName - The other propertyUsed to restrict a value to be greater than or equal to the given value
property - The propertyvalue - The valueCreates a subquery criterion that ensures the given property is greater than all the given returned values
propertyName - The property namepropertyValue - The property valueCreates a subquery criterion that ensures the given property is greater than all the given returned values
propertyName - The property namepropertyValue - The property valueConstraints a property to be greater than or equal to a specified other property
propertyName - The propertyotherPropertyName - The other propertyDefines a group by projection for datastores that support it
property - The property nameUsed to restrict a value to be greater than or equal to the given value
property - The propertyvalue - The valueCreates a subquery criterion that ensures the given property is greater than all the given returned values
propertyName - The property namepropertyValue - The property valueCreates a subquery criterion that ensures the given property is greater than all the given returned values
propertyName - The property namepropertyValue - The property valueConstraints a property to be greater than a specified other property
propertyName - The propertyotherPropertyName - The other propertyUsed to restrict a value to be greater than or equal to the given value
property - The propertyvalue - The valueCreates an "equals" Criterion based on the specified property name and value.
propertyValue - The property valueCreates an ilike Criterion based on the specified property name and value. Unlike a like condition, ilike is case insensitive
propertyName - The property namepropertyValue - The property valueCreates an "in" Criterion based on the specified property name and list of values.
propertyName - The property namevalues - The valuesCreates an "in" Criterion based on the specified property name and list of values.
propertyName - The property namevalues - The valuesCreates an "in" Criterion based on the specified property name and list of values.
propertyName - The property namevalues - The valuesCreates an "in" Criterion based on the specified property name and list of values.
propertyName - The property namevalues - The valuesUsed to restrict a value to be less than or equal to the given value
property - The propertyvalue - The valueCreates a subquery criterion that ensures the given property is less than all the given returned values
propertyName - The property namepropertyValue - The property valueCreates a subquery criterion that ensures the given property is less than all the given returned values
propertyName - The property namepropertyValue - The property valueConstraints a property to be less than or equal to a specified other property
propertyName - The propertyotherPropertyName - The other propertyCreates an like Criterion based on the specified property name and value.
propertyName - The property namepropertyValue - The property valueUsed to restrict a value to be less than or equal to the given value
property - The propertyvalue - The valueCreates a subquery criterion that ensures the given property is less than all the given returned values
propertyName - The property namepropertyValue - The property valueCreates a subquery criterion that ensures the given property is less than all the given returned values
propertyName - The property namepropertyValue - The property valueConstraints a property to be less than a specified other property
propertyName - The propertyotherPropertyName - The other propertyUsed to restrict a value to be less than or equal to the given value
property - The propertyvalue - The valueComputes the max value of a property
name - The name of the propertyComputes the min value of a property
name - The name of the propertyCreates a "not equals" Criterion based on the specified property name and value.
propertyName - The property namepropertyValue - The property valueConstraints a property to be not equal to a specified other property
propertyName - The propertyotherPropertyName - The other propertyOrders by the specified property name (defaults to ascending)
propertyName - The property name to order byOrders by the specified property name (defaults to ascending)
o - The order objectOrders by the specified property name and direction
propertyName - The property name to order bydirection - Either "asc" for ascending or "desc" for descendingDefines projections
callable - The closure defining the projectionsA projection that obtains the value of a property of an entity
name - The name of the propertyCreates an rlike Criterion based on the specified property name and value.
propertyName - The property namepropertyValue - The property valueCount the number of records returned
Computes the sum of a property
name - The name of the property