Instance methods of the GORM API.
- the entity/domain classFields inherited from class | Fields |
---|---|
class AbstractGormApi |
persistentClass, persistentEntity |
class AbstractDatastoreApi |
datastore |
Type | Name and description |
---|---|
boolean |
failOnError |
java.lang.Class<java.lang.Exception> |
validationException |
Constructor and description |
---|
GormInstanceApi
(java.lang.Class<D> persistentClass, Datastore datastore) |
Type | Name and description |
---|---|
D |
attach(java.lang.Object instance) Attaches an instance to an existing session. |
void |
delete(java.lang.Object instance) Deletes an instance from the datastore |
void |
delete(java.lang.Object instance, java.util.Map params) Deletes an instance from the datastore |
void |
discard(java.lang.Object instance) Discards any pending changes. |
protected D |
doSave(java.lang.Object instance, java.util.Map params, Session session) |
protected java.lang.Class<java.lang.Exception> |
getValidationException() |
java.io.Serializable |
ident(java.lang.Object instance) Returns the objects identifier |
boolean |
instanceOf(java.lang.Object o, java.lang.Class cls) Proxy aware instanceOf implementation. |
boolean |
isAttached(java.lang.Object instance) No concept of session-based model so defaults to true |
D |
lock(java.lang.Object instance) Upgrades an existing persistence instance to a write lock |
D |
merge(java.lang.Object instance) Saves an object the datastore |
D |
merge(java.lang.Object instance, java.util.Map params) Saves an object the datastore |
java.lang.Object |
mutex(java.lang.Object instance, groovy.lang.Closure callable) Locks the instance for updates for the scope of the passed closure |
D |
refresh(java.lang.Object instance) Refreshes the state of the current instance |
D |
save(java.lang.Object instance) Saves an object the datastore |
D |
save(java.lang.Object instance, boolean validate) Save method that takes a boolean which indicates whether to perform validation or not |
D |
save(java.lang.Object instance, java.util.Map params) Saves an object with the given parameters |
Methods inherited from class | Name |
---|---|
class AbstractGormApi |
getExtendedMethods, getMethods |
class AbstractDatastoreApi |
execute, execute |
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Attaches an instance to an existing session. Requries a session-based model
instance
- The instanceDeletes an instance from the datastore
instance
- The instance to deleteDeletes an instance from the datastore
instance
- The instance to deleteDiscards any pending changes. Requires a session-based model.
Returns the objects identifier
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
instance
- The instanceSaves an object the datastore
instance
- The instanceLocks the instance for updates for the scope of the passed closure
callable
- The closureRefreshes the state of the current instance
instance
- The instanceSaves an object the datastore
instance
- The instanceSave method that takes a boolean which indicates whether to perform validation or not
instance
- The instancevalidate
- Whether to perform validationSaves an object with the given parameters
instance
- The instanceparams
- The parameters