A Persister is responsible for persisting and retrieving an object.
Type Params | Return Type | Name and description |
---|---|---|
|
Query |
createQuery() Creates a query for the entity |
|
void |
delete(java.lang.Iterable objects) Deletes one or many objects |
|
void |
delete(java.lang.Object obj) Deletes a single object |
|
java.io.Serializable |
getObjectIdentifier(java.lang.Object o) Get the identifier for the given object, if it has one. |
|
java.lang.Class |
getType() The type this persister persists |
|
java.io.Serializable |
insert(java.lang.Object o) Forces an insert of an object rather than trying to guess if it is an insert or an update |
|
java.io.Serializable |
persist(java.lang.Object obj) Persist an object using the given mapping context |
|
java.util.List<java.io.Serializable> |
persist(java.lang.Iterable objs) Persists a number of objects at the same time and returns their keys in the order specified by the objs parameter |
|
java.lang.Object |
proxy(java.io.Serializable key) Creates a proxy for the given key |
|
java.io.Serializable |
refresh(java.lang.Object o) Refreshes the given objects state |
|
java.lang.Object |
retrieve(java.io.Serializable key) Retrieves an object for the given context and Key |
|
java.util.List<java.lang.Object> |
retrieveAll(java.lang.Iterable<java.io.Serializable> keys) Batch retrieve several objects in one go |
|
java.util.List<java.lang.Object> |
retrieveAll(java.io.Serializable[] keys) Batch retrieve several objects in one go |
Creates a query for the entity
Deletes one or many objects
objects
- The objects to delete. Must all be of the same type or an exception will be thrown.Deletes a single object
obj
- The objectGet the identifier for the given object, if it has one.
o
- The object.The type this persister persists
Forces an insert of an object rather than trying to guess if it is an insert or an update
o
- The objectPersist an object using the given mapping context
obj
- The objectPersists a number of objects at the same time and returns their keys in the order specified by the objs parameter
objs
- The objectsCreates a proxy for the given key
key
- The keyRefreshes the given objects state
o
- The object to refreshRetrieves an object for the given context and Key
key
- The keyBatch retrieve several objects in one go
keys
- The keysBatch retrieve several objects in one go
keys
- The keys