grails.gorm
Class CriteriaBuilder

java.lang.Object
  extended by groovy.lang.GroovyObjectSupport
      extended by grails.gorm.CriteriaBuilder
All Implemented Interfaces:
groovy.lang.GroovyObject, org.grails.datastore.mapping.query.api.Criteria, org.grails.datastore.mapping.query.api.ProjectionList

public class CriteriaBuilder
extends groovy.lang.GroovyObjectSupport
implements org.grails.datastore.mapping.query.api.Criteria, org.grails.datastore.mapping.query.api.ProjectionList

Criteria builder implementation that operates against Spring datastore abstraction.

Since:
1.0

Field Summary
static java.lang.String ORDER_ASCENDING
           
static java.lang.String ORDER_DESCENDING
           
protected  java.util.List<org.grails.datastore.mapping.query.Query.Order> orderEntries
           
protected  org.grails.datastore.mapping.model.PersistentEntity persistentEntity
           
protected  org.grails.datastore.mapping.query.Query.ProjectionList projectionList
           
protected  org.grails.datastore.mapping.query.Query query
           
protected  groovy.lang.MetaObjectProtocol queryMetaClass
           
protected  org.grails.datastore.mapping.core.Session session
           
protected  java.lang.Class targetClass
           
 
Constructor Summary
CriteriaBuilder(java.lang.Class targetClass, org.grails.datastore.mapping.core.Session session)
           
CriteriaBuilder(java.lang.Class targetClass, org.grails.datastore.mapping.core.Session session, org.grails.datastore.mapping.query.Query query)
           
 
Method Summary
protected  org.grails.datastore.mapping.query.Query.Criterion addToCriteria(org.grails.datastore.mapping.query.Query.Criterion c)
           
 org.grails.datastore.mapping.query.api.Criteria and(groovy.lang.Closure callable)
           
 org.grails.datastore.mapping.query.api.ProjectionList avg(java.lang.String name)
          Computes the average value of a property
 org.grails.datastore.mapping.query.api.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)
           
 org.grails.datastore.mapping.query.api.Criteria cache(boolean cache)
           
 org.grails.datastore.mapping.query.Query.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.
 org.grails.datastore.mapping.query.api.ProjectionList countDistinct(java.lang.String property)
          Projection that signifies to count distinct results
 org.grails.datastore.mapping.query.api.ProjectionList distinct()
          Projection that signifies to return only distinct results
 org.grails.datastore.mapping.query.api.ProjectionList distinct(java.lang.String property)
          Projection that signifies to return only distinct results
 org.grails.datastore.mapping.query.api.Criteria eq(java.lang.String propertyName, java.lang.Object propertyValue)
          Creates an "equals" Criterion based on the specified property name and value.
 org.grails.datastore.mapping.query.api.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
 org.grails.datastore.mapping.query.api.Criteria eqAll(java.lang.String propertyName, org.grails.datastore.mapping.query.api.QueryableCriteria propertyValue)
          Creates a subquery criterion that ensures the given property is equal to all the given returned values
 org.grails.datastore.mapping.query.api.Criteria eqProperty(java.lang.String propertyName, java.lang.String otherPropertyName)
          Constraints a property to be equal to a specified other property
 org.grails.datastore.mapping.query.api.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
 org.grails.datastore.mapping.query.api.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
 org.grails.datastore.mapping.query.api.Criteria geAll(java.lang.String propertyName, org.grails.datastore.mapping.query.api.QueryableCriteria propertyValue)
          Creates a subquery criterion that ensures the given property is greater than all the given returned values
 org.grails.datastore.mapping.query.api.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.
 org.grails.datastore.mapping.query.Query getQuery()
           
 org.grails.datastore.mapping.query.api.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
 org.grails.datastore.mapping.query.api.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
 org.grails.datastore.mapping.query.api.Criteria gtAll(java.lang.String propertyName, org.grails.datastore.mapping.query.api.QueryableCriteria propertyValue)
          Creates a subquery criterion that ensures the given property is greater than all the given returned values
 org.grails.datastore.mapping.query.api.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
 org.grails.datastore.mapping.query.api.Criteria gtProperty(java.lang.String propertyName, java.lang.String otherPropertyName)
          Constraints a property to be greater than a specified other property
 org.grails.datastore.mapping.query.Query.ProjectionList id()
           
 org.grails.datastore.mapping.query.api.Criteria idEq(java.lang.Object propertyValue)
          Creates an "equals" Criterion based on the specified property name and value.
 org.grails.datastore.mapping.query.api.Criteria idEquals(java.lang.Object value)
           
 org.grails.datastore.mapping.query.api.Criteria ilike(java.lang.String propertyName, java.lang.Object propertyValue)
          Creates an ilike Criterion based on the specified property name and value.
 org.grails.datastore.mapping.query.api.Criteria in(java.lang.String propertyName, java.util.Collection values)
          Creates an "in" Criterion based on the specified property name and list of values.
 org.grails.datastore.mapping.query.api.Criteria in(java.lang.String propertyName, java.lang.Object[] values)
          Creates an "in" Criterion based on the specified property name and list of values.
 org.grails.datastore.mapping.query.api.Criteria inList(java.lang.String propertyName, java.util.Collection values)
          Creates an "in" Criterion based on the specified property name and list of values.
 org.grails.datastore.mapping.query.api.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)
           
 org.grails.datastore.mapping.query.api.Criteria isEmpty(java.lang.String propertyName)
           
 org.grails.datastore.mapping.query.api.Criteria isNotEmpty(java.lang.String propertyName)
           
 org.grails.datastore.mapping.query.api.Criteria isNotNull(java.lang.String propertyName)
           
 org.grails.datastore.mapping.query.api.Criteria isNull(java.lang.String propertyName)
           
 org.grails.datastore.mapping.query.api.Criteria join(java.lang.String property)
           
 org.grails.datastore.mapping.query.api.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
 org.grails.datastore.mapping.query.api.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
 org.grails.datastore.mapping.query.api.Criteria leAll(java.lang.String propertyName, org.grails.datastore.mapping.query.api.QueryableCriteria propertyValue)
          Creates a subquery criterion that ensures the given property is less than all the given returned values
 org.grails.datastore.mapping.query.api.Criteria leProperty(java.lang.String propertyName, java.lang.String otherPropertyName)
          Constraints a property to be less than or equal to a specified other property
 org.grails.datastore.mapping.query.api.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.
 org.grails.datastore.mapping.query.api.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
 org.grails.datastore.mapping.query.api.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
 org.grails.datastore.mapping.query.api.Criteria ltAll(java.lang.String propertyName, org.grails.datastore.mapping.query.api.QueryableCriteria propertyValue)
          Creates a subquery criterion that ensures the given property is less than all the given returned values
 org.grails.datastore.mapping.query.api.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
 org.grails.datastore.mapping.query.api.Criteria ltProperty(java.lang.String propertyName, java.lang.String otherPropertyName)
          Constraints a property to be less than a specified other property
 org.grails.datastore.mapping.query.api.ProjectionList max(java.lang.String name)
          Computes the max value of a property
 org.grails.datastore.mapping.query.api.ProjectionList min(java.lang.String name)
          Computes the min value of a property
 org.grails.datastore.mapping.query.api.Criteria ne(java.lang.String propertyName, java.lang.Object propertyValue)
          Creates a "not equals" Criterion based on the specified property name and value.
 org.grails.datastore.mapping.query.api.Criteria neProperty(java.lang.String propertyName, java.lang.String otherPropertyName)
          Constraints a property to be not equal to a specified other property
 org.grails.datastore.mapping.query.api.Criteria not(groovy.lang.Closure callable)
           
 org.grails.datastore.mapping.query.api.Criteria or(groovy.lang.Closure callable)
           
 org.grails.datastore.mapping.query.api.Criteria order(java.lang.String propertyName)
          Orders by the specified property name (defaults to ascending)
 org.grails.datastore.mapping.query.api.Criteria order(java.lang.String propertyName, java.lang.String direction)
          Orders by the specified property name and direction
 org.grails.datastore.mapping.query.api.ProjectionList projections(groovy.lang.Closure callable)
          Defines projections
 org.grails.datastore.mapping.query.api.ProjectionList property(java.lang.String name)
          A projection that obtains the value of a property of an entity
 org.grails.datastore.mapping.query.api.Criteria rlike(java.lang.String propertyName, java.lang.Object propertyValue)
          Creates an rlike Criterion based on the specified property name and value.
 org.grails.datastore.mapping.query.api.ProjectionList rowCount()
          Count the number of records returned
 void setUniqueResult(boolean uniqueResult)
           
 org.grails.datastore.mapping.query.api.Criteria sizeEq(java.lang.String propertyName, int size)
           
 org.grails.datastore.mapping.query.api.Criteria sizeGe(java.lang.String propertyName, int size)
           
 org.grails.datastore.mapping.query.api.Criteria sizeGt(java.lang.String propertyName, int size)
           
 org.grails.datastore.mapping.query.api.Criteria sizeLe(java.lang.String propertyName, int size)
           
 org.grails.datastore.mapping.query.api.Criteria sizeLt(java.lang.String propertyName, int size)
           
 org.grails.datastore.mapping.query.api.Criteria sizeNe(java.lang.String propertyName, int size)
           
 org.grails.datastore.mapping.query.api.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 groovy.lang.GroovyObjectSupport
getMetaClass, getProperty, setMetaClass, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ORDER_DESCENDING

public static final java.lang.String ORDER_DESCENDING
See Also:
Constant Field Values

ORDER_ASCENDING

public static final java.lang.String ORDER_ASCENDING
See Also:
Constant Field Values

targetClass

protected java.lang.Class targetClass

session

protected org.grails.datastore.mapping.core.Session session

query

protected org.grails.datastore.mapping.query.Query query

orderEntries

protected java.util.List<org.grails.datastore.mapping.query.Query.Order> orderEntries

queryMetaClass

protected groovy.lang.MetaObjectProtocol queryMetaClass

projectionList

protected org.grails.datastore.mapping.query.Query.ProjectionList projectionList

persistentEntity

protected org.grails.datastore.mapping.model.PersistentEntity persistentEntity
Constructor Detail

CriteriaBuilder

public CriteriaBuilder(java.lang.Class targetClass,
                       org.grails.datastore.mapping.core.Session session)

CriteriaBuilder

public CriteriaBuilder(java.lang.Class targetClass,
                       org.grails.datastore.mapping.core.Session session,
                       org.grails.datastore.mapping.query.Query query)
Method Detail

setUniqueResult

public void setUniqueResult(boolean uniqueResult)

cache

public org.grails.datastore.mapping.query.api.Criteria cache(boolean cache)

join

public org.grails.datastore.mapping.query.api.Criteria join(java.lang.String property)

id

public org.grails.datastore.mapping.query.Query.ProjectionList id()
Specified by:
id in interface org.grails.datastore.mapping.query.api.ProjectionList

count

public org.grails.datastore.mapping.query.Query.ProjectionList count()
Count the number of records returned

Specified by:
count in interface org.grails.datastore.mapping.query.api.ProjectionList
Returns:
The project list

countDistinct

public org.grails.datastore.mapping.query.api.ProjectionList countDistinct(java.lang.String property)
Projection that signifies to count distinct results

Specified by:
countDistinct in interface org.grails.datastore.mapping.query.api.ProjectionList
Parameters:
property - The name of the property
Returns:
The projection list

distinct

public org.grails.datastore.mapping.query.api.ProjectionList distinct()
Projection that signifies to return only distinct results

Specified by:
distinct in interface org.grails.datastore.mapping.query.api.ProjectionList
Returns:
The projection list

distinct

public org.grails.datastore.mapping.query.api.ProjectionList distinct(java.lang.String property)
Projection that signifies to return only distinct results

Specified by:
distinct in interface org.grails.datastore.mapping.query.api.ProjectionList
Parameters:
property - The name of the property
Returns:
The projection list

rowCount

public org.grails.datastore.mapping.query.api.ProjectionList rowCount()
Count the number of records returned

Specified by:
rowCount in interface org.grails.datastore.mapping.query.api.ProjectionList
Returns:
The project list

property

public org.grails.datastore.mapping.query.api.ProjectionList property(java.lang.String name)
A projection that obtains the value of a property of an entity

Specified by:
property in interface org.grails.datastore.mapping.query.api.ProjectionList
Parameters:
name - The name of the property
Returns:
The projection list

sum

public org.grails.datastore.mapping.query.api.ProjectionList sum(java.lang.String name)
Computes the sum of a property

Specified by:
sum in interface org.grails.datastore.mapping.query.api.ProjectionList
Parameters:
name - The name of the property
Returns:
The projection list

min

public org.grails.datastore.mapping.query.api.ProjectionList min(java.lang.String name)
Computes the min value of a property

Specified by:
min in interface org.grails.datastore.mapping.query.api.ProjectionList
Parameters:
name - The name of the property
Returns:
The projection list

max

public org.grails.datastore.mapping.query.api.ProjectionList max(java.lang.String name)
Computes the max value of a property

Specified by:
max in interface org.grails.datastore.mapping.query.api.ProjectionList
Parameters:
name - The name of the property
Returns:
The PropertyProjection instance

avg

public org.grails.datastore.mapping.query.api.ProjectionList avg(java.lang.String name)
Computes the average value of a property

Specified by:
avg in interface org.grails.datastore.mapping.query.api.ProjectionList
Parameters:
name - The name of the property
Returns:
The PropertyProjection instance

list

public java.util.List list(groovy.lang.Closure callable)
Defines an executes a list query in a single call. Example: Foo.createCriteria.list { }

Parameters:
callable - The closure to execute
Returns:
The result list

get

public java.lang.Object get(groovy.lang.Closure callable)
Defines an executes a get query ( a single result) in a single call. Example: Foo.createCriteria.get { }

Parameters:
callable - The closure to execute
Returns:
A single result

listDistinct

public java.util.List listDistinct(groovy.lang.Closure callable)
Defines an executes a list distinct query in a single call. Example: Foo.createCriteria.listDistinct { }

Parameters:
callable - The closure to execute
Returns:
The result list

list

public java.util.List list(java.util.Map paginateParams,
                           groovy.lang.Closure callable)

count

public java.lang.Number count(groovy.lang.Closure callable)
Defines an executes a count query in a single call. Example: Foo.createCriteria.count { }

Parameters:
callable - The closure to execute
Returns:
The result count

invokeMethod

public java.lang.Object invokeMethod(java.lang.String name,
                                     java.lang.Object obj)
Specified by:
invokeMethod in interface groovy.lang.GroovyObject
Overrides:
invokeMethod in class groovy.lang.GroovyObjectSupport

projections

public org.grails.datastore.mapping.query.api.ProjectionList projections(groovy.lang.Closure callable)
Defines projections

Parameters:
callable - The closure defining the projections
Returns:
The projections list

and

public org.grails.datastore.mapping.query.api.Criteria and(groovy.lang.Closure callable)

or

public org.grails.datastore.mapping.query.api.Criteria or(groovy.lang.Closure callable)

not

public org.grails.datastore.mapping.query.api.Criteria not(groovy.lang.Closure callable)

idEquals

public org.grails.datastore.mapping.query.api.Criteria idEquals(java.lang.Object value)
Specified by:
idEquals in interface org.grails.datastore.mapping.query.api.Criteria

isEmpty

public org.grails.datastore.mapping.query.api.Criteria isEmpty(java.lang.String propertyName)
Specified by:
isEmpty in interface org.grails.datastore.mapping.query.api.Criteria

isNotEmpty

public org.grails.datastore.mapping.query.api.Criteria isNotEmpty(java.lang.String propertyName)
Specified by:
isNotEmpty in interface org.grails.datastore.mapping.query.api.Criteria

isNull

public org.grails.datastore.mapping.query.api.Criteria isNull(java.lang.String propertyName)
Specified by:
isNull in interface org.grails.datastore.mapping.query.api.Criteria

isNotNull

public org.grails.datastore.mapping.query.api.Criteria isNotNull(java.lang.String propertyName)
Specified by:
isNotNull in interface org.grails.datastore.mapping.query.api.Criteria

eq

public org.grails.datastore.mapping.query.api.Criteria eq(java.lang.String propertyName,
                                                          java.lang.Object propertyValue)
Creates an "equals" Criterion based on the specified property name and value.

Specified by:
eq in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property name
propertyValue - The property value
Returns:
A Criterion instance

eqAll

public org.grails.datastore.mapping.query.api.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

Parameters:
propertyName - The property name
propertyValue - The property value
Returns:
A Criterion instance

gtAll

public org.grails.datastore.mapping.query.api.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

Parameters:
propertyName - The property name
propertyValue - The property value
Returns:
A Criterion instance

ltAll

public org.grails.datastore.mapping.query.api.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

Parameters:
propertyName - The property name
propertyValue - The property value
Returns:
A Criterion instance

geAll

public org.grails.datastore.mapping.query.api.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

Parameters:
propertyName - The property name
propertyValue - The property value
Returns:
A Criterion instance

leAll

public org.grails.datastore.mapping.query.api.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

Parameters:
propertyName - The property name
propertyValue - The property value
Returns:
A Criterion instance

eqAll

public org.grails.datastore.mapping.query.api.Criteria eqAll(java.lang.String propertyName,
                                                             org.grails.datastore.mapping.query.api.QueryableCriteria propertyValue)
Creates a subquery criterion that ensures the given property is equal to all the given returned values

Specified by:
eqAll in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property name
propertyValue - The property value
Returns:
A Criterion instance

gtAll

public org.grails.datastore.mapping.query.api.Criteria gtAll(java.lang.String propertyName,
                                                             org.grails.datastore.mapping.query.api.QueryableCriteria propertyValue)
Creates a subquery criterion that ensures the given property is greater than all the given returned values

Specified by:
gtAll in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property name
propertyValue - The property value
Returns:
A Criterion instance

ltAll

public org.grails.datastore.mapping.query.api.Criteria ltAll(java.lang.String propertyName,
                                                             org.grails.datastore.mapping.query.api.QueryableCriteria propertyValue)
Creates a subquery criterion that ensures the given property is less than all the given returned values

Specified by:
ltAll in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property name
propertyValue - The property value
Returns:
A Criterion instance

geAll

public org.grails.datastore.mapping.query.api.Criteria geAll(java.lang.String propertyName,
                                                             org.grails.datastore.mapping.query.api.QueryableCriteria propertyValue)
Creates a subquery criterion that ensures the given property is greater than all the given returned values

Specified by:
geAll in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property name
propertyValue - The property value
Returns:
A Criterion instance

leAll

public org.grails.datastore.mapping.query.api.Criteria leAll(java.lang.String propertyName,
                                                             org.grails.datastore.mapping.query.api.QueryableCriteria propertyValue)
Creates a subquery criterion that ensures the given property is less than all the given returned values

Specified by:
leAll in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property name
propertyValue - The property value
Returns:
A Criterion instance

idEq

public org.grails.datastore.mapping.query.api.Criteria idEq(java.lang.Object propertyValue)
Creates an "equals" Criterion based on the specified property name and value.

Specified by:
idEq in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyValue - The property value
Returns:
A Criterion instance

ne

public org.grails.datastore.mapping.query.api.Criteria ne(java.lang.String propertyName,
                                                          java.lang.Object propertyValue)
Creates a "not equals" Criterion based on the specified property name and value.

Specified by:
ne in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property name
propertyValue - The property value
Returns:
A Criterion instance

between

public org.grails.datastore.mapping.query.api.Criteria between(java.lang.String propertyName,
                                                               java.lang.Object start,
                                                               java.lang.Object finish)
Restricts the results by the given property value range (inclusive)

Specified by:
between in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property name
start - The start of the range
finish - The end of the range
Returns:
A Criterion instance

gte

public org.grails.datastore.mapping.query.api.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

Specified by:
gte in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
property - The property
value - The value
Returns:
The Criterion instance

ge

public org.grails.datastore.mapping.query.api.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

Specified by:
ge in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
property - The property
value - The value
Returns:
The Criterion instance

gt

public org.grails.datastore.mapping.query.api.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

Specified by:
gt in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
property - The property
value - The value
Returns:
The Criterion instance

lte

public org.grails.datastore.mapping.query.api.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

Specified by:
lte in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
property - The property
value - The value
Returns:
The Criterion instance

le

public org.grails.datastore.mapping.query.api.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

Specified by:
le in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
property - The property
value - The value
Returns:
The Criterion instance

lt

public org.grails.datastore.mapping.query.api.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

Specified by:
lt in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
property - The property
value - The value
Returns:
The Criterion instance

like

public org.grails.datastore.mapping.query.api.Criteria like(java.lang.String propertyName,
                                                            java.lang.Object propertyValue)
Creates an like Criterion based on the specified property name and value.

Specified by:
like in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property name
propertyValue - The property value
Returns:
A Criterion instance

ilike

public org.grails.datastore.mapping.query.api.Criteria ilike(java.lang.String propertyName,
                                                             java.lang.Object propertyValue)
Creates an ilike Criterion based on the specified property name and value. Unlike a like condition, ilike is case insensitive

Specified by:
ilike in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property name
propertyValue - The property value
Returns:
A Criterion instance

rlike

public org.grails.datastore.mapping.query.api.Criteria rlike(java.lang.String propertyName,
                                                             java.lang.Object propertyValue)
Creates an rlike Criterion based on the specified property name and value.

Specified by:
rlike in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property name
propertyValue - The property value
Returns:
A Criterion instance

in

public org.grails.datastore.mapping.query.api.Criteria in(java.lang.String propertyName,
                                                          java.util.Collection values)
Creates an "in" Criterion based on the specified property name and list of values.

Specified by:
in in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property name
values - The values
Returns:
A Criterion instance

inList

public org.grails.datastore.mapping.query.api.Criteria inList(java.lang.String propertyName,
                                                              java.util.Collection values)
Creates an "in" Criterion based on the specified property name and list of values.

Specified by:
inList in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property name
values - The values
Returns:
A Criterion instance

inList

public org.grails.datastore.mapping.query.api.Criteria inList(java.lang.String propertyName,
                                                              java.lang.Object[] values)
Creates an "in" Criterion based on the specified property name and list of values.

Specified by:
inList in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property name
values - The values
Returns:
A Criterion instance

in

public org.grails.datastore.mapping.query.api.Criteria in(java.lang.String propertyName,
                                                          java.lang.Object[] values)
Creates an "in" Criterion based on the specified property name and list of values.

Specified by:
in in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property name
values - The values
Returns:
A Criterion instance

sizeEq

public org.grails.datastore.mapping.query.api.Criteria sizeEq(java.lang.String propertyName,
                                                              int size)
Specified by:
sizeEq in interface org.grails.datastore.mapping.query.api.Criteria

sizeGt

public org.grails.datastore.mapping.query.api.Criteria sizeGt(java.lang.String propertyName,
                                                              int size)
Specified by:
sizeGt in interface org.grails.datastore.mapping.query.api.Criteria

sizeGe

public org.grails.datastore.mapping.query.api.Criteria sizeGe(java.lang.String propertyName,
                                                              int size)
Specified by:
sizeGe in interface org.grails.datastore.mapping.query.api.Criteria

sizeLe

public org.grails.datastore.mapping.query.api.Criteria sizeLe(java.lang.String propertyName,
                                                              int size)
Specified by:
sizeLe in interface org.grails.datastore.mapping.query.api.Criteria

sizeLt

public org.grails.datastore.mapping.query.api.Criteria sizeLt(java.lang.String propertyName,
                                                              int size)
Specified by:
sizeLt in interface org.grails.datastore.mapping.query.api.Criteria

sizeNe

public org.grails.datastore.mapping.query.api.Criteria sizeNe(java.lang.String propertyName,
                                                              int size)
Specified by:
sizeNe in interface org.grails.datastore.mapping.query.api.Criteria

eqProperty

public org.grails.datastore.mapping.query.api.Criteria eqProperty(java.lang.String propertyName,
                                                                  java.lang.String otherPropertyName)
Constraints a property to be equal to a specified other property

Specified by:
eqProperty in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property
otherPropertyName - The other property
Returns:
This criteria

neProperty

public org.grails.datastore.mapping.query.api.Criteria neProperty(java.lang.String propertyName,
                                                                  java.lang.String otherPropertyName)
Constraints a property to be not equal to a specified other property

Specified by:
neProperty in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property
otherPropertyName - The other property
Returns:
This criteria

gtProperty

public org.grails.datastore.mapping.query.api.Criteria gtProperty(java.lang.String propertyName,
                                                                  java.lang.String otherPropertyName)
Constraints a property to be greater than a specified other property

Specified by:
gtProperty in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property
otherPropertyName - The other property
Returns:
This criteria

geProperty

public org.grails.datastore.mapping.query.api.Criteria geProperty(java.lang.String propertyName,
                                                                  java.lang.String otherPropertyName)
Constraints a property to be greater than or equal to a specified other property

Specified by:
geProperty in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property
otherPropertyName - The other property
Returns:
This criteria

ltProperty

public org.grails.datastore.mapping.query.api.Criteria ltProperty(java.lang.String propertyName,
                                                                  java.lang.String otherPropertyName)
Constraints a property to be less than a specified other property

Specified by:
ltProperty in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property
otherPropertyName - The other property
Returns:
This criteria

leProperty

public org.grails.datastore.mapping.query.api.Criteria leProperty(java.lang.String propertyName,
                                                                  java.lang.String otherPropertyName)
Constraints a property to be less than or equal to a specified other property

Specified by:
leProperty in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property
otherPropertyName - The other property
Returns:
This criteria

order

public org.grails.datastore.mapping.query.api.Criteria order(java.lang.String propertyName)
Orders by the specified property name (defaults to ascending)

Specified by:
order in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property name to order by
Returns:
A Order instance

order

public org.grails.datastore.mapping.query.api.Criteria order(java.lang.String propertyName,
                                                             java.lang.String direction)
Orders by the specified property name and direction

Specified by:
order in interface org.grails.datastore.mapping.query.api.Criteria
Parameters:
propertyName - The property name to order by
direction - Either "asc" for ascending or "desc" for descending
Returns:
A Order instance

validatePropertyName

protected void validatePropertyName(java.lang.String propertyName,
                                    java.lang.String methodName)

addToCriteria

protected org.grails.datastore.mapping.query.Query.Criterion addToCriteria(org.grails.datastore.mapping.query.Query.Criterion c)

getQuery

public org.grails.datastore.mapping.query.Query getQuery()

build

public void build(groovy.lang.Closure criteria)