@java.lang.SuppressWarnings("rawtypes") public class CriteriaBuilder extends groovy.lang.GroovyObjectSupport
Criteria builder implementation that operates against Spring datastore abstraction.
Modifiers | Name | Description |
---|---|---|
static java.lang.String |
ORDER_ASCENDING |
|
static java.lang.String |
ORDER_DESCENDING |
|
protected java.util.List<Query.Order> |
orderEntries |
|
protected PersistentEntity |
persistentEntity |
|
protected ProjectionList |
projectionList |
|
protected Query |
query |
|
protected groovy.lang.MetaObjectProtocol |
queryMetaClass |
|
protected Session |
session |
|
protected java.lang.Class |
targetClass |
Constructor and description |
---|
CriteriaBuilder
(java.lang.Class targetClass, Session session) |
CriteriaBuilder
(java.lang.Class targetClass, Session session, Query query) |
Type | Name and description |
---|---|
protected Criterion |
addToCriteria(Criterion c) |
Criteria |
and(groovy.lang.Closure callable) |
ProjectionList |
avg(java.lang.String name) Computes the average value of a property |
Criteria |
between(java.lang.String propertyName, java.lang.Object start, java.lang.Object finish) Restricts the results by the given property value range (inclusive) |
void |
build(groovy.lang.Closure criteria) |
ProjectionList |
count() Count the number of records returned |
java.lang.Number |
count(groovy.lang.Closure callable) Defines an executes a count query in a single call. |
ProjectionList |
countDistinct(java.lang.String property) Projection that signifies to count distinct results |
ProjectionList |
distinct() Projection that signifies to return only distinct results |
ProjectionList |
distinct(java.lang.String property) Projection that signifies to return only distinct results |
Criteria |
eq(java.lang.String propertyName, java.lang.Object propertyValue) Creates an "equals" Criterion based on the specified property name and value. |
Criteria |
eqAll(java.lang.String propertyName, groovy.lang.Closure propertyValue) Creates a subquery criterion that ensures the given property is equal to all the given returned values |
Criteria |
eqAll(java.lang.String propertyName, QueryableCriteria propertyValue) Creates a subquery criterion that ensures the given property is equal to all the given returned values |
Criteria |
eqProperty(java.lang.String propertyName, java.lang.String otherPropertyName) Constraints a property to be equal to a specified other property |
Criteria |
ge(java.lang.String property, java.lang.Object value) Used to restrict a value to be greater than or equal to the given value |
Criteria |
geAll(java.lang.String propertyName, groovy.lang.Closure propertyValue) Creates a subquery criterion that ensures the given property is greater than all the given returned values |
Criteria |
geAll(java.lang.String propertyName, QueryableCriteria propertyValue) Creates a subquery criterion that ensures the given property is greater than all the given returned values |
Criteria |
geProperty(java.lang.String propertyName, java.lang.String otherPropertyName) Constraints a property to be greater than or equal to a specified other property |
java.lang.Object |
get(groovy.lang.Closure callable) Defines an executes a get query ( a single result) in a single call. |
Query |
getQuery() |
Criteria |
gt(java.lang.String property, java.lang.Object value) Used to restrict a value to be greater than or equal to the given value |
Criteria |
gtAll(java.lang.String propertyName, groovy.lang.Closure propertyValue) Creates a subquery criterion that ensures the given property is greater than all the given returned values |
Criteria |
gtAll(java.lang.String propertyName, QueryableCriteria propertyValue) Creates a subquery criterion that ensures the given property is greater than all the given returned values |
Criteria |
gtProperty(java.lang.String propertyName, java.lang.String otherPropertyName) Constraints a property to be greater than a specified other property |
Criteria |
gte(java.lang.String property, java.lang.Object value) Used to restrict a value to be greater than or equal to the given value |
ProjectionList |
id() |
Criteria |
idEq(java.lang.Object propertyValue) Creates an "equals" Criterion based on the specified property name and value. |
Criteria |
idEquals(java.lang.Object value) |
Criteria |
ilike(java.lang.String propertyName, java.lang.Object propertyValue) Creates an ilike Criterion based on the specified property name and value. |
Criteria |
in(java.lang.String propertyName, java.util.Collection values) Creates an "in" Criterion based on the specified property name and list of values. |
Criteria |
in(java.lang.String propertyName, java.lang.Object[] values) Creates an "in" Criterion based on the specified property name and list of values. |
Criteria |
inList(java.lang.String propertyName, java.util.Collection values) Creates an "in" Criterion based on the specified property name and list of values. |
Criteria |
inList(java.lang.String propertyName, java.lang.Object[] values) Creates an "in" Criterion based on the specified property name and list of values. |
java.lang.Object |
invokeMethod(java.lang.String name, java.lang.Object obj) |
Criteria |
isEmpty(java.lang.String propertyName) |
Criteria |
isNotEmpty(java.lang.String propertyName) |
Criteria |
isNotNull(java.lang.String propertyName) |
Criteria |
isNull(java.lang.String propertyName) |
Criteria |
le(java.lang.String property, java.lang.Object value) Used to restrict a value to be less than or equal to the given value |
Criteria |
leAll(java.lang.String propertyName, groovy.lang.Closure propertyValue) Creates a subquery criterion that ensures the given property is less than all the given returned values |
Criteria |
leAll(java.lang.String propertyName, QueryableCriteria propertyValue) Creates a subquery criterion that ensures the given property is less than all the given returned values |
Criteria |
leProperty(java.lang.String propertyName, java.lang.String otherPropertyName) Constraints a property to be less than or equal to a specified other property |
Criteria |
like(java.lang.String propertyName, java.lang.Object propertyValue) Creates an like Criterion based on the specified property name and value. |
java.util.List |
list(groovy.lang.Closure callable) Defines an executes a list query in a single call. |
java.util.List |
list(java.util.Map paginateParams, groovy.lang.Closure callable) |
java.util.List |
listDistinct(groovy.lang.Closure callable) Defines an executes a list distinct query in a single call. |
Criteria |
lt(java.lang.String property, java.lang.Object value) Used to restrict a value to be less than or equal to the given value |
Criteria |
ltAll(java.lang.String propertyName, groovy.lang.Closure propertyValue) Creates a subquery criterion that ensures the given property is less than all the given returned values |
Criteria |
ltAll(java.lang.String propertyName, QueryableCriteria propertyValue) Creates a subquery criterion that ensures the given property is less than all the given returned values |
Criteria |
ltProperty(java.lang.String propertyName, java.lang.String otherPropertyName) Constraints a property to be less than a specified other property |
Criteria |
lte(java.lang.String property, java.lang.Object value) Used to restrict a value to be less than or equal to the given value |
ProjectionList |
max(java.lang.String name) Computes the max value of a property |
ProjectionList |
min(java.lang.String name) Computes the min value of a property |
Criteria |
ne(java.lang.String propertyName, java.lang.Object propertyValue) Creates a "not equals" Criterion based on the specified property name and value. |
Criteria |
neProperty(java.lang.String propertyName, java.lang.String otherPropertyName) Constraints a property to be not equal to a specified other property |
Criteria |
not(groovy.lang.Closure callable) |
Criteria |
or(groovy.lang.Closure callable) |
Criteria |
order(java.lang.String propertyName) Orders by the specified property name (defaults to ascending) |
Criteria |
order(java.lang.String propertyName, java.lang.String direction) Orders by the specified property name and direction |
ProjectionList |
projections(groovy.lang.Closure callable) Defines projections |
ProjectionList |
property(java.lang.String name) A projection that obtains the value of a property of an entity |
Criteria |
rlike(java.lang.String propertyName, java.lang.Object propertyValue) Creates an rlike Criterion based on the specified property name and value. |
ProjectionList |
rowCount() Count the number of records returned |
void |
setUniqueResult(boolean uniqueResult) |
Criteria |
sizeEq(java.lang.String propertyName, int size) |
Criteria |
sizeGe(java.lang.String propertyName, int size) |
Criteria |
sizeGt(java.lang.String propertyName, int size) |
Criteria |
sizeLe(java.lang.String propertyName, int size) |
Criteria |
sizeLt(java.lang.String propertyName, int size) |
Criteria |
sizeNe(java.lang.String propertyName, int size) |
ProjectionList |
sum(java.lang.String name) Computes the sum of a property |
protected void |
validatePropertyName(java.lang.String propertyName, java.lang.String methodName) |
Methods inherited from class | Name |
---|---|
class groovy.lang.GroovyObjectSupport |
groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll() |
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Computes 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
Defines an executes a count query in a single call. Example: Foo.createCriteria.count { }
callable
- The closure to executeProjection 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 an executes a get query ( a single result) in a single call. Example: Foo.createCriteria.get { }
callable
- The closure to executeUsed 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 valueDefines an executes a list query in a single call. Example: Foo.createCriteria.list { }
callable
- The closure to executeDefines an executes a list distinct query in a single call. Example: Foo.createCriteria.listDistinct { }
callable
- The closure to executeUsed 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 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