class DetachedCriteria extends org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria
Represents criteria that is not bound to the current connection and can be built up and re-used at a later date
Modifiers | Name | Description |
---|---|---|
class |
DetachedCriteria.DetachedProjections |
Fields inherited from class | Fields |
---|---|
class org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria |
__$stMC |
Type | Name and description |
---|---|
ProjectionList |
projectionList |
Constructor and description |
---|
DetachedCriteria
(java.lang.Class<T> targetClass) Constructs a DetachedCriteria instance target the given class |
Type | Name and description |
---|---|
void |
add(Criterion criterion) |
Criteria |
and(groovy.lang.Closure callable) Handles a conjunction |
Criteria |
between(java.lang.String propertyName, java.lang.Object start, java.lang.Object finish) @see Criteria |
DetachedCriteria<T> |
build(groovy.lang.Closure callable) Enable the builder syntax for contructing Criteria |
protected DetachedCriteria<T> |
clone() |
java.lang.Number |
count(java.util.Map args = Collections.emptyMap(, groovy.lang.Closure additionalCriteria = null) Counts the number of records returned by the query |
java.lang.Number |
count(groovy.lang.Closure additionalCriteria) Counts the number of records returned by the query |
java.lang.Number |
deleteAll() Deletes all entities matching this criteria |
DetachedCriteria<T> |
distinct(java.lang.String property) Adds a distinct property projection |
Criteria |
eq(java.lang.String propertyName, java.lang.Object propertyValue) @see Criteria |
Criteria |
eqAll(java.lang.String propertyName, groovy.lang.Closure propertyValue) |
Criteria |
eqAll(java.lang.String propertyName, QueryableCriteria propertyValue) |
Criteria |
eqProperty(java.lang.String propertyName, java.lang.String otherPropertyName) @see Criteria |
boolean |
exists(groovy.lang.Closure additionalCriteria) Counts the number of records returned by the query |
T |
find(java.util.Map args = Collections.emptyMap(, groovy.lang.Closure additionalCriteria = null) Synonym for #get |
T |
find(groovy.lang.Closure additionalCriteria) Synonym for #get |
Criteria |
ge(java.lang.String property, java.lang.Object value) @see Criteria |
Criteria |
geAll(java.lang.String propertyName, groovy.lang.Closure propertyValue) |
Criteria |
geAll(java.lang.String propertyName, QueryableCriteria propertyValue) |
Criteria |
geProperty(java.lang.String propertyName, java.lang.String otherPropertyName) @see Criteria |
T |
get(java.util.Map args = Collections.emptyMap(, groovy.lang.Closure additionalCriteria = null) Lists all records matching the criterion contained within this DetachedCriteria instance |
T |
get(groovy.lang.Closure additionalCriteria) Lists all records matching the criterion contained within this DetachedCriteria instance |
java.util.List<Criterion> |
getCriteria() |
java.util.List<Order> |
getOrders() |
PersistentEntity |
getPersistentEntity() |
java.util.List<Projection> |
getProjections() |
Criteria |
gt(java.lang.String property, java.lang.Object value) @see Criteria |
Criteria |
gtAll(java.lang.String propertyName, groovy.lang.Closure propertyValue) |
Criteria |
gtAll(java.lang.String propertyName, QueryableCriteria propertyValue) |
Criteria |
gtProperty(java.lang.String propertyName, java.lang.String otherPropertyName) @see Criteria |
Criteria |
gte(java.lang.String property, java.lang.Object value) @see Criteria |
protected void |
handleJunction(groovy.lang.Closure callable) |
Criteria |
idEq(java.lang.Object propertyValue) @see Criteria |
Criteria |
idEquals(java.lang.Object value) @see Criteria |
Criteria |
ilike(java.lang.String propertyName, java.lang.Object propertyValue) @see Criteria |
Criteria |
in(java.lang.String propertyName, java.util.Collection values) @see Criteria |
Criteria |
in(java.lang.String propertyName, java.lang.Object[] values) @see Criteria |
Criteria |
inList(java.lang.String propertyName, java.util.Collection values) @see Criteria |
Criteria |
inList(java.lang.String propertyName, java.lang.Object[] values) @see Criteria |
protected java.lang.Object |
initialiseIfNecessary(java.lang.Class<T> targetClass) |
Criteria |
isEmpty(java.lang.String propertyName) @see Criteria |
Criteria |
isNotEmpty(java.lang.String propertyName) @see Criteria |
Criteria |
isNotNull(java.lang.String propertyName) @see Criteria |
Criteria |
isNull(java.lang.String propertyName) @see Criteria |
java.util.Iterator<T> |
iterator() |
Criteria |
le(java.lang.String property, java.lang.Object value) @see Criteria |
Criteria |
leAll(java.lang.String propertyName, groovy.lang.Closure propertyValue) |
Criteria |
leAll(java.lang.String propertyName, QueryableCriteria propertyValue) |
Criteria |
leProperty(java.lang.String propertyName, java.lang.String otherPropertyName) @see Criteria |
Criteria |
like(java.lang.String propertyName, java.lang.Object propertyValue) @see Criteria |
java.util.List<T> |
list(java.util.Map args = Collections.emptyMap(, groovy.lang.Closure additionalCriteria = null) Lists all records matching the criterion contained within this DetachedCriteria instance |
java.util.List<T> |
list(groovy.lang.Closure additionalCriteria) Lists all records matching the criterion contained within this DetachedCriteria instance |
Criteria |
lt(java.lang.String property, java.lang.Object value) @see Criteria |
Criteria |
ltAll(java.lang.String propertyName, groovy.lang.Closure propertyValue) |
Criteria |
ltAll(java.lang.String propertyName, QueryableCriteria propertyValue) |
Criteria |
ltProperty(java.lang.String propertyName, java.lang.String otherPropertyName) @see Criteria |
Criteria |
lte(java.lang.String property, java.lang.Object value) @see Criteria |
DetachedCriteria<T> |
max(int max) Sets the default max to use and returns a new criteria instance. |
java.lang.Object |
methodMissing(java.lang.String methodName, java.lang.Object args) Method missing handler that deals with the invocation of dynamic finders |
Criteria |
ne(java.lang.String propertyName, java.lang.Object propertyValue) @see Criteria |
Criteria |
neProperty(java.lang.String propertyName, java.lang.String otherPropertyName) @see Criteria |
Criteria |
not(groovy.lang.Closure callable) Handles a disjunction |
DetachedCriteria<T> |
offset(int offset) Sets the default offset to use and returns a new criteria instance. |
Criteria |
or(groovy.lang.Closure callable) Handles a disjunction |
Criteria |
order(java.lang.String propertyName) @see Criteria |
Criteria |
order(java.lang.String propertyName, java.lang.String direction) @see Criteria |
Criteria |
projections(groovy.lang.Closure callable) Evaluate projections within the context of the given closure |
DetachedCriteria<T> |
property(java.lang.String property) Adds a property projection |
java.lang.Object |
propertyMissing(java.lang.String name) |
Criteria |
rlike(java.lang.String propertyName, java.lang.Object propertyValue) @see Criteria |
Criteria |
sizeEq(java.lang.String propertyName, int size) @see Criteria |
Criteria |
sizeGe(java.lang.String propertyName, int size) @see Criteria |
Criteria |
sizeGt(java.lang.String propertyName, int size) @see Criteria |
Criteria |
sizeLe(java.lang.String propertyName, int size) @see Criteria |
Criteria |
sizeLt(java.lang.String propertyName, int size) @see Criteria |
Criteria |
sizeNe(java.lang.String propertyName, int size) @see Criteria |
DetachedCriteria<T> |
sort(java.lang.String property) Adds a sort order to this criteria instance |
DetachedCriteria<T> |
sort(java.lang.String property, java.lang.String direction) Adds a sort order to this criteria instance |
java.lang.Number |
updateAll(java.util.Map properties) Updates all entities matching this criteria |
DetachedCriteria<T> |
where(groovy.lang.Closure additionalQuery) Where method derives a new query from this query. |
Methods inherited from class | Name |
---|---|
class org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria |
org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#readOnly(boolean), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#distinct(java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#between(java.lang.String, java.lang.Object, java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#getMetaClass(), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#setMetaClass(groovy.lang.MetaClass), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#invokeMethod(java.lang.String, java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#property(java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#not(groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#build(groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#gt(java.lang.String, java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#le(java.lang.String, java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#propertyMissing(java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#this$dist$invoke$1(java.lang.String, java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#this$dist$set$1(java.lang.String, java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#this$dist$get$1(java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#methodMissing(java.lang.String, java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#getAlias(), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#getProjectionList(), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#super$1$clone(), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#idEq(java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#projections(groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#allEq(java.util.Map), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#where(groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#whereLazy(groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#buildLazy(groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#getPersistentClass(), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#sizeEq(java.lang.String, int), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#sizeGt(java.lang.String, int), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#sizeGe(java.lang.String, int), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#sizeLe(java.lang.String, int), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#sizeLt(java.lang.String, int), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#sizeNe(java.lang.String, int), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#eqProperty(java.lang.String, java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#neProperty(java.lang.String, java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#gtProperty(java.lang.String, java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#geProperty(java.lang.String, java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#ltProperty(java.lang.String, java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#leProperty(java.lang.String, java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#idEquals(java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#notExists(org.grails.datastore.mapping.query.api.QueryableCriteria), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#isNotEmpty(java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#isNotNull(java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#ne(java.lang.String, java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#gte(java.lang.String, java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#ge(java.lang.String, java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#lte(java.lang.String, java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#like(java.lang.String, java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#ilike(java.lang.String, java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#rlike(java.lang.String, java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#eqAll(java.lang.String, groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#eqAll(java.lang.String, org.grails.datastore.mapping.query.api.QueryableCriteria), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#gtAll(java.lang.String, groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#gtAll(java.lang.String, org.grails.datastore.mapping.query.api.QueryableCriteria), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#ltAll(java.lang.String, groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#ltAll(java.lang.String, org.grails.datastore.mapping.query.api.QueryableCriteria), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#geAll(java.lang.String, org.grails.datastore.mapping.query.api.QueryableCriteria), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#geAll(java.lang.String, groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#leAll(java.lang.String, groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#leAll(java.lang.String, org.grails.datastore.mapping.query.api.QueryableCriteria), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#gtSome(java.lang.String, org.grails.datastore.mapping.query.api.QueryableCriteria), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#gtSome(java.lang.String, groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#geSome(java.lang.String, org.grails.datastore.mapping.query.api.QueryableCriteria), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#geSome(java.lang.String, groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#ltSome(java.lang.String, groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#ltSome(java.lang.String, org.grails.datastore.mapping.query.api.QueryableCriteria), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#leSome(java.lang.String, org.grails.datastore.mapping.query.api.QueryableCriteria), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#leSome(java.lang.String, groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#getFetchStrategies(), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#getPersistentEntity(), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#setProjectionList(org.grails.datastore.mapping.query.api.ProjectionList), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#setAlias(java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#createAlias(java.lang.String, java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#getCriteria(), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#getProjections(), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#getOrders(), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#avg(java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#select(java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#inList(java.lang.String, java.util.Collection), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#inList(java.lang.String, [Ljava.lang.Object;), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#inList(java.lang.String, org.grails.datastore.mapping.query.api.QueryableCriteria), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#inList(java.lang.String, groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#notIn(java.lang.String, groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#notIn(java.lang.String, org.grails.datastore.mapping.query.api.QueryableCriteria), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#add(org.grails.datastore.mapping.query.Query$Criterion), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#setProperty(java.lang.String, java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#getProperty(java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#cache(boolean), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#offset(int), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#min(java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#max(java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#max(int), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#isEmpty(java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#join(java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#lt(java.lang.String, java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#in(java.lang.String, [Ljava.lang.Object;), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#in(java.lang.String, org.grails.datastore.mapping.query.api.QueryableCriteria), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#in(java.lang.String, groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#in(java.lang.String, java.util.Collection), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#sum(java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#sort(java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#sort(java.lang.String, java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#eq(java.lang.String, java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#isNull(java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#order(java.lang.String, java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#order(java.lang.String), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#order(org.grails.datastore.mapping.query.Query$Order), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#exists(org.grails.datastore.mapping.query.api.QueryableCriteria), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#and(groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#or(groovy.lang.Closure), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#id(), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#wait(long, int), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#wait(long), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#wait(), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#equals(java.lang.Object), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#toString(), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#hashCode(), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#getClass(), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#notify(), org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria#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() |
Constructs a DetachedCriteria instance target the given class
Handles a conjunction
callable
- Callable closure
Enable the builder syntax for contructing Criteria
callable
- The callable closureCounts the number of records returned by the query
args
- The argumentsCounts the number of records returned by the query
args
- The argumentsDeletes all entities matching this criteria
Adds a distinct property projection
property
- The property to obtain the distinct value for
Counts the number of records returned by the query
args
- The argumentsSynonym for #get
Synonym for #get
Lists all records matching the criterion contained within this DetachedCriteria instance
Lists all records matching the criterion contained within this DetachedCriteria instance
Lists all records matching the criterion contained within this DetachedCriteria instance
Lists all records matching the criterion contained within this DetachedCriteria instance
Sets the default max to use and returns a new criteria instance. This method does not mutate the original criteria!
max
- The max to useMethod missing handler that deals with the invocation of dynamic finders
methodName
- The method nameargs
- The arguments
Handles a disjunction
callable
- Callable closureSets the default offset to use and returns a new criteria instance. This method does not mutate the original criteria!
offset
- The offset to useHandles a disjunction
callable
- Callable closureEvaluate projections within the context of the given closure
callable
- The callableAdds a property projection
property
- The property to sort byAdds a sort order to this criteria instance
property
- The property to sort byAdds a sort order to this criteria instance
property
- The property to sort bydirection
- The direction to sort byUpdates all entities matching this criteria
Where method derives a new query from this query. This method will not mutate the original query, but instead return a new one.
additionalQuery
- The additional query