withDatastoreSession(groovy.lang.Closure<T> callable)Same as withSession, but present for the case where withSession is overridden to use the Hibernate session

<T>

T

withNewSession(groovy.lang.Closure<T> callable)Creates and binds a new session for the scope of the given closure

<T>

T

withNewTransaction(groovy.lang.Closure<T> callable)Executes the closure within the context of a new transaction

<T>

T

withNewTransaction(java.util.Map transactionProperties, groovy.lang.Closure<T> callable)Executes the closure within the context of a new transaction which is
configured with the properties contained in transactionProperties.

<T>

T

withSession(groovy.lang.Closure<T> callable)Execute a closure whose first argument is a reference to the current session.

<T>

T

withStatelessSession(groovy.lang.Closure<T> callable)Creates and binds a new session for the scope of the given closure

withTransaction(groovy.lang.Closure<T> callable)Executes the closure within the context of a transaction, creating one if none is present or joining
an existing transaction if one is already present.

<T>

T

withTransaction(java.util.Map transactionProperties, groovy.lang.Closure<T> callable)Executes the closure within the context of a transaction which is
configured with the properties contained in transactionProperties.

<T>

T

withTransaction(org.springframework.transaction.TransactionDefinition definition, groovy.lang.Closure<T> callable)Executes the closure within the context of a transaction for the given org.springframework.transaction.TransactionDefinition

Finds all results matching all of the given conditions. Eg. Book.findAllWhere(author:"Stephen King", title:"The Stand")

Parameters:

queryMap - The map of conditions

args - The Query arguments

Returns:

A list of results

D findOrCreateWhere(java.util.Map queryMap)

Finds a single result matching all of the given conditions. Eg. Book.findWhere(author:"Stephen King", title:"The Stand"). If
a matching persistent entity is not found a new entity is created and returned.

Parameters:

queryMap - The map of conditions

Returns:

A single result

D findOrSaveWhere(java.util.Map queryMap)

Finds a single result matching all of the given conditions. Eg. Book.findWhere(author:"Stephen King", title:"The Stand"). If
a matching persistent entity is not found a new entity is created, saved and returned.

Parameters:

queryMap - The map of conditions

Returns:

A single result

D findWhere(java.util.Map queryMap)

Finds a single result matching all of the given conditions. Eg. Book.findWhere(author:"Stephen King", title:"The Stand")

Parameters:

queryMap - The map of conditions

Returns:

A single result

D findWhere(java.util.Map queryMap, java.util.Map args)

Finds a single result matching all of the given conditions. Eg. Book.findWhere(author:"Stephen King", title:"The Stand")

Parameters:

queryMap - The map of conditions

args - The Query arguments

Returns:

A single result

D first()

Finds the first object using the natural sort order

Returns:

the first object in the datastore, null if none exist

D first(java.lang.String propertyName)

Finds the first object sorted by propertyName

Parameters:

propertyName - the name of the property to sort by

Returns:

the first object in the datastore sorted by propertyName, null if none exist

D first(java.util.Map queryParams)

Finds the first object. If queryParams includes 'sort', that will
dictate the sort order, otherwise natural sort order will be used.
queryParams may include any of the same parameters that might be passed
to the list(Map) method. This method will ignore 'order' and 'max' as
those are always 'asc' and 1, respectively.

D last(java.lang.String propertyName)

the last object in the datastore sorted by propertyName, null if none exist

D last(java.util.Map queryParams)

Finds the last object. If queryParams includes 'sort', that will
dictate the sort order, otherwise natural sort order will be used.
queryParams may include any of the same parameters that might be passed
to the list(Map) method. This method will ignore 'order' and 'max' as
those are always 'asc' and 1, respectively.

Executes the closure within the context of a new transaction which is
configured with the properties contained in transactionProperties.
transactionProperties may contain any properties supported by
org.springframework.transaction.support.DefaultTransactionDefinition. Note that if transactionProperties
includes entries for propagationBehavior or propagationName, those values
will be ignored. This method always sets the propagation level to
TransactionDefinition.REQUIRES_NEW.

Executes the closure within the context of a transaction which is
configured with the properties contained in transactionProperties.
transactionProperties may contain any properties supported by
org.springframework.transaction.support.DefaultTransactionDefinition.