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