public interface Persister
A Persister is responsible for persisting and retrieving an object.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public Query |
createQuery()Creates a query for the entity |
|
public void |
delete(Iterable objects)Deletes one or many objects |
|
public void |
delete(Object obj)Deletes a single object |
|
public Serializable |
getObjectIdentifier(Object o)Get the identifier for the given object, if it has one. |
|
public Class |
getType()The type this persister persists |
|
public Serializable |
insert(Object o)Forces an insert of an object rather than trying to guess if it is an insert or an update |
|
public Serializable |
persist(Object obj)Persist an object using the given mapping context |
|
public List<Serializable> |
persist(Iterable objs)Persists a number of objects at the same time and returns their keys in the order specified by the objs parameter |
|
public Object |
proxy(Serializable key)Creates a proxy for the given key |
|
public Serializable |
refresh(Object o)Refreshes the given objects state |
|
public Object |
retrieve(Serializable key)Retrieves an object for the given context and Key |
|
public List<Object> |
retrieveAll(Iterable<Serializable> keys)Batch retrieve several objects in one go |
|
public List<Object> |
retrieveAll(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