@groovy.transform.CompileStatic class DetachedCriteria extends AbstractDetachedCriteria
Represents criteria that is not bound to the current connection and can be built up and re-used at a later date.
| Fields inherited from class | Fields | 
|---|---|
class AbstractDetachedCriteria | 
                            alias, associationCriteriaMap, criteria, defaultMax, defaultOffset, dynamicFinders, fetchStrategies, junctions, lazyQuery, orders, persistentEntity, projections, targetClass | 
                        
| Constructor and description | 
|---|
                                DetachedCriteria
                                (java.lang.Class<T> targetClass, java.lang.String alias = null)Constructs a DetachedCriteria instance target the given class and alias for the name  | 
                        
| Type | Name and description | 
|---|---|
DetachedCriteria<T> | 
                            allEq(java.util.Map<java.lang.String, java.lang.Object> propertyValues) | 
                        
DetachedCriteria<T> | 
                            and(groovy.lang.Closure callable) | 
                        
protected void | 
                            applyLazyCriteria() | 
                        
boolean | 
                            asBoolean(groovy.lang.Closure additionalCriteria = null)Counts the number of records returned by the query  | 
                        
DetachedCriteria<T> | 
                            avg(java.lang.String property)Adds a avg projection  | 
                        
DetachedCriteria<T> | 
                            between(java.lang.String propertyName, java.lang.Object start, java.lang.Object finish) | 
                        
DetachedCriteria<T> | 
                            build(groovy.lang.Closure callable)Enable the builder syntax for constructing Criteria  | 
                        
DetachedCriteria<T> | 
                            buildLazy(groovy.lang.Closure callable)Enable the builder syntax for constructing Criteria  | 
                        
protected QueryableCriteria | 
                            buildQueryableCriteria(groovy.lang.Closure queryClosure) | 
                        
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  | 
                        
DetachedCriteria<T> | 
                            eq(java.lang.String propertyName, java.lang.Object propertyValue) | 
                        
DetachedCriteria<T> | 
                            eqAll(java.lang.String propertyName, groovy.lang.Closure<?> propertyValue) | 
                        
DetachedCriteria<T> | 
                            eqAll(java.lang.String propertyName, QueryableCriteria propertyValue) | 
                        
DetachedCriteria<T> | 
                            eqProperty(java.lang.String propertyName, java.lang.String otherPropertyName) | 
                        
DetachedCriteria<T> | 
                            exists(QueryableCriteria<?> subquery) | 
                        
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  | 
                        
DetachedCriteria<T> | 
                            ge(java.lang.String property, java.lang.Object value) | 
                        
DetachedCriteria<T> | 
                            geAll(java.lang.String propertyName, groovy.lang.Closure<?> propertyValue) | 
                        
DetachedCriteria<T> | 
                            geAll(java.lang.String propertyName, QueryableCriteria propertyValue) | 
                        
DetachedCriteria<T> | 
                            geProperty(java.lang.String propertyName, java.lang.String otherPropertyName) | 
                        
DetachedCriteria<T> | 
                            geSome(java.lang.String propertyName, QueryableCriteria propertyValue) | 
                        
DetachedCriteria<T> | 
                            geSome(java.lang.String propertyName, groovy.lang.Closure<?> propertyValue) | 
                        
T | 
                            get(java.util.Map args = Collections.emptyMap(, groovy.lang.Closure additionalCriteria = null)Returns a single result matching the criterion contained within this DetachedCriteria instance  | 
                        
T | 
                            get(groovy.lang.Closure additionalCriteria)Returns a single result matching the criterion contained within this DetachedCriteria instance  | 
                        
AsyncQuery<T> | 
                            getAsync()@return The async version of the DetachedCriteria API  | 
                        
DetachedCriteria<T> | 
                            gt(java.lang.String property, java.lang.Object value) | 
                        
DetachedCriteria<T> | 
                            gtAll(java.lang.String propertyName, groovy.lang.Closure<?> propertyValue) | 
                        
DetachedCriteria<T> | 
                            gtAll(java.lang.String propertyName, QueryableCriteria propertyValue) | 
                        
DetachedCriteria<T> | 
                            gtProperty(java.lang.String propertyName, java.lang.String otherPropertyName) | 
                        
DetachedCriteria<T> | 
                            gtSome(java.lang.String propertyName, QueryableCriteria propertyValue) | 
                        
DetachedCriteria<T> | 
                            gtSome(java.lang.String propertyName, groovy.lang.Closure<?> propertyValue) | 
                        
DetachedCriteria<T> | 
                            gte(java.lang.String property, java.lang.Object value) | 
                        
protected void | 
                            handleJunction(groovy.lang.Closure callable) | 
                        
DetachedCriteria<T> | 
                            id()Adds an id projection  | 
                        
DetachedCriteria<T> | 
                            idEq(java.lang.Object propertyValue) | 
                        
DetachedCriteria<T> | 
                            idEquals(java.lang.Object value) | 
                        
DetachedCriteria<T> | 
                            ilike(java.lang.String propertyName, java.lang.Object propertyValue) | 
                        
DetachedCriteria<T> | 
                            in(java.lang.String propertyName, java.util.Collection values) | 
                        
DetachedCriteria<T> | 
                            in(java.lang.String propertyName, QueryableCriteria subquery) | 
                        
DetachedCriteria<T> | 
                            in(java.lang.String propertyName, groovy.lang.Closure<?> subquery) | 
                        
DetachedCriteria<T> | 
                            in(java.lang.String propertyName, java.lang.Object[] values) | 
                        
DetachedCriteria<T> | 
                            inList(java.lang.String propertyName, QueryableCriteria<?> subquery) | 
                        
DetachedCriteria<T> | 
                            inList(java.lang.String propertyName, groovy.lang.Closure<?> subquery) | 
                        
DetachedCriteria<T> | 
                            inList(java.lang.String propertyName, java.util.Collection values) | 
                        
DetachedCriteria<T> | 
                            inList(java.lang.String propertyName, java.lang.Object[] values) | 
                        
DetachedCriteria<T> | 
                            isEmpty(java.lang.String propertyName) | 
                        
DetachedCriteria<T> | 
                            isNotEmpty(java.lang.String propertyName) | 
                        
DetachedCriteria<T> | 
                            isNotNull(java.lang.String propertyName) | 
                        
DetachedCriteria<T> | 
                            isNull(java.lang.String propertyName) | 
                        
java.util.Iterator<T> | 
                            iterator() | 
                        
DetachedCriteria<T> | 
                            join(java.lang.String property) | 
                        
DetachedCriteria<T> | 
                            le(java.lang.String property, java.lang.Object value) | 
                        
DetachedCriteria<T> | 
                            leAll(java.lang.String propertyName, groovy.lang.Closure<?> propertyValue) | 
                        
DetachedCriteria<T> | 
                            leAll(java.lang.String propertyName, QueryableCriteria propertyValue) | 
                        
DetachedCriteria<T> | 
                            leProperty(java.lang.String propertyName, java.lang.String otherPropertyName) | 
                        
DetachedCriteria<T> | 
                            leSome(java.lang.String propertyName, QueryableCriteria propertyValue) | 
                        
DetachedCriteria<T> | 
                            leSome(java.lang.String propertyName, groovy.lang.Closure<?> propertyValue) | 
                        
DetachedCriteria<T> | 
                            like(java.lang.String propertyName, java.lang.Object propertyValue) | 
                        
java.util.List<T> | 
                            list(java.util.Map args = Collections.emptyMap(, groovy.lang.Closure additionalCriteria = null)Returns a single result 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  | 
                        
DetachedCriteria<T> | 
                            lt(java.lang.String property, java.lang.Object value) | 
                        
DetachedCriteria<T> | 
                            ltAll(java.lang.String propertyName, groovy.lang.Closure<?> propertyValue) | 
                        
DetachedCriteria<T> | 
                            ltAll(java.lang.String propertyName, QueryableCriteria propertyValue) | 
                        
DetachedCriteria<T> | 
                            ltProperty(java.lang.String propertyName, java.lang.String otherPropertyName) | 
                        
DetachedCriteria<T> | 
                            ltSome(java.lang.String propertyName, QueryableCriteria propertyValue) | 
                        
DetachedCriteria<T> | 
                            ltSome(java.lang.String propertyName, groovy.lang.Closure<?> propertyValue) | 
                        
DetachedCriteria<T> | 
                            lte(java.lang.String property, java.lang.Object value) | 
                        
DetachedCriteria<T> | 
                            max(int max)Sets the default max to use and returns a new criteria instance.  | 
                        
DetachedCriteria<T> | 
                            max(java.lang.String property)Adds a min projection  | 
                        
DetachedCriteria<T> | 
                            min(java.lang.String property)Adds a sum projection  | 
                        
DetachedCriteria<T> | 
                            ne(java.lang.String propertyName, java.lang.Object propertyValue) | 
                        
DetachedCriteria<T> | 
                            neProperty(java.lang.String propertyName, java.lang.String otherPropertyName) | 
                        
protected DetachedCriteria | 
                            newInstance() | 
                        
DetachedCriteria<T> | 
                            not(groovy.lang.Closure callable) | 
                        
DetachedCriteria<T> | 
                            notExists(QueryableCriteria<?> subquery) | 
                        
DetachedCriteria<T> | 
                            notIn(java.lang.String propertyName, QueryableCriteria<?> subquery) | 
                        
DetachedCriteria<T> | 
                            notIn(java.lang.String propertyName, groovy.lang.Closure<?> subquery) | 
                        
DetachedCriteria<T> | 
                            offset(int offset)Sets the default offset to use and returns a new criteria instance.  | 
                        
DetachedCriteria<T> | 
                            or(groovy.lang.Closure callable) | 
                        
DetachedCriteria<T> | 
                            order(java.lang.String propertyName) | 
                        
DetachedCriteria<T> | 
                            order(Order o) | 
                        
DetachedCriteria<T> | 
                            order(java.lang.String propertyName, java.lang.String direction) | 
                        
DetachedCriteria<T> | 
                            projections(groovy.lang.Closure callable)Defines projections.  | 
                        
DetachedCriteria<T> | 
                            property(java.lang.String property)Adds a property projection  | 
                        
DetachedCriteria<T> | 
                            rlike(java.lang.String propertyName, java.lang.Object propertyValue) | 
                        
DetachedCriteria<T> | 
                            select(java.lang.String property) | 
                        
java.lang.Number | 
                            size()Synonym for #count()  | 
                        
DetachedCriteria<T> | 
                            sizeEq(java.lang.String propertyName, int size) | 
                        
DetachedCriteria<T> | 
                            sizeGe(java.lang.String propertyName, int size) | 
                        
DetachedCriteria<T> | 
                            sizeGt(java.lang.String propertyName, int size) | 
                        
DetachedCriteria<T> | 
                            sizeLe(java.lang.String propertyName, int size) | 
                        
DetachedCriteria<T> | 
                            sizeLt(java.lang.String propertyName, int size) | 
                        
DetachedCriteria<T> | 
                            sizeNe(java.lang.String propertyName, int size) | 
                        
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  | 
                        
DetachedCriteria<T> | 
                            sum(java.lang.String property)Adds a sum projection  | 
                        
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.  | 
                        
DetachedCriteria<T> | 
                            whereLazy(groovy.lang.Closure additionalQuery)Where method derives a new query from this query.  | 
                        
Constructs a DetachedCriteria instance target the given class and alias for the name
targetClass -  The target classalias -  The root alias to be used in queriesCounts the number of records returned by the query
args -  The argumentsAdds a avg projection
property -  The property to avg byEnable the builder syntax for constructing Criteria
callable -  The callable closureEnable the builder syntax for constructing 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 forSynonym for #get
Synonym for #get
Returns a single result matching the criterion contained within this DetachedCriteria instance
Returns a single result matching the criterion contained within this DetachedCriteria instance
Adds an id projection
property -  The property to projectReturns a single result 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 useAdds a min projection
property -  The property to max byAdds a sum projection
property -  The property to min bySets the default offset to use and returns a new criteria instance. This method does not mutate the original criteria!
offset -  The offset to useDefines projections.
callable -  The callableAdds a property projection
property -  The property to projectSynonym for #count()
Adds 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 byAdds a sum projection
property -  The property to sum 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 queryWhere 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