interface GormInstanceOperations<D>
Instance methods of the GORM API.
D
- the entity/domain classType Params | Return Type | Name and description |
---|---|---|
|
abstract D |
attach(D instance) Attaches an instance to an existing session. |
|
abstract void |
delete(D instance) Deletes an instance from the datastore |
|
abstract void |
delete(D instance, java.util.Map params) Deletes an instance from the datastore |
|
abstract void |
discard(D instance) Discards any pending changes. |
|
abstract java.io.Serializable |
ident(D instance) Returns the objects identifier |
|
abstract D |
insert(D instance) Forces an insert of an object to the datastore |
|
abstract D |
insert(D instance, java.util.Map params) Forces an insert of an object to the datastore |
|
abstract boolean |
instanceOf(D instance, java.lang.Class cls) Proxy aware instanceOf implementation. |
|
abstract boolean |
isAttached(D instance) No concept of session-based model so defaults to true |
|
abstract D |
lock(D instance) Upgrades an existing persistence instance to a write lock |
|
abstract D |
merge(D instance) Saves an object the datastore |
|
abstract D |
merge(D instance, java.util.Map params) Saves an object the datastore |
<T> |
abstract T |
mutex(D instance, groovy.lang.Closure<T> callable) Locks the instance for updates for the scope of the passed closure |
|
abstract java.lang.Object |
propertyMissing(D instance, java.lang.String name) Allow access to datasource by name |
|
abstract D |
refresh(D instance) Refreshes the state of the current instance |
|
abstract D |
save(D instance) Saves an object the datastore |
|
abstract D |
save(D instance, boolean validate) Save method that takes a boolean which indicates whether to perform validation or not |
|
abstract D |
save(D instance, java.util.Map params) Saves an object with the given parameters |
Attaches an instance to an existing session. Requries a session-based model @return
Deletes an instance from the datastore
Deletes an instance from the datastore
Discards any pending changes. Requires a session-based model.
Returns the objects identifier
Forces an insert of an object to the datastore
Forces an insert of an object to the datastore
Proxy aware instanceOf implementation.
No concept of session-based model so defaults to true
Upgrades an existing persistence instance to a write lock
Saves an object the datastore
Saves an object the datastore
Locks the instance for updates for the scope of the passed closure
callable
- The closureAllow access to datasource by name
instance
- The instancename
- The property nameRefreshes the state of the current instance
Saves an object the datastore
Save method that takes a boolean which indicates whether to perform validation or not
validate
- Whether to perform validationSaves an object with the given parameters
instance
- The instanceparams
- The parameters