Interface PersistenceContextEntityManager
-
- All Superinterfaces:
EntityManager
public interface PersistenceContextEntityManager extends EntityManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> void
delete(T entity, PersistenceContext persistenceContext)
Deletes an entity from the persistence backendObject
find(WmId primaryKey, PersistenceContext persistenceContext)
Looks up an entity by its id<T> T
persist(T entity, PersistenceContext persistenceContext)
Persists an entity which is not yet persisted (i.e.void
registerEntityDomainClass(EntityDomain entityDomain, String classname)
Meant to be called from EntityDomain in order to create a mapping from classnames to EntityDomains.<T> T
save(T entity, PersistenceContext persistenceContext)
Saves an entity that was persisted before (i.e.void
unregisterEntityDomainClass(String classname)
Meant to be called from EntityDomain in order to update the mapping from classnames to EntityDomains.-
Methods inherited from interface nl.gx.webmanager.services.entitymanager.EntityManager
copy, delete, find, getAll, getId, getInstance, getInstance, getWmId, isManageable, persist, removeProperty, save
-
-
-
-
Method Detail
-
find
Object find(WmId primaryKey, PersistenceContext persistenceContext)
Looks up an entity by its id- Parameters:
primaryKey
- the id identifying the entity to loadpersistenceContext
-- Returns:
- the requested entity or null if it wasn't found
-
persist
<T> T persist(T entity, PersistenceContext persistenceContext)
Persists an entity which is not yet persisted (i.e. which doesn't have its' WmId filled in yet)- Type Parameters:
T
- The type of the entity to persist- Parameters:
entity
- The entity to persistpersistenceContext
-- Returns:
- The persisted entity with its WmId filled in.
-
delete
<T> void delete(T entity, PersistenceContext persistenceContext) throws DomainException
Deletes an entity from the persistence backend- Type Parameters:
T
- The type of the entity to delete- Parameters:
entity
- The entity to be deletedpersistenceContext
-- Throws:
DomainException
- when something went wrong while deleting the entity
-
save
<T> T save(T entity, PersistenceContext persistenceContext) throws DomainException
Saves an entity that was persisted before (i.e. which does have its' WmId filled in)- Type Parameters:
T
- The type of the entity to persist- Parameters:
entity
- The entity to persistpersistenceContext
-- Returns:
- The entity
- Throws:
DomainException
- when something went wrong while saving the entity
-
registerEntityDomainClass
void registerEntityDomainClass(EntityDomain entityDomain, String classname)
Meant to be called from EntityDomain in order to create a mapping from classnames to EntityDomains.- Parameters:
entityDomain
- the EntityDomain which can handle entities of the specified classclassname
- the name of a Class the EntityDomain can handle
-
unregisterEntityDomainClass
void unregisterEntityDomainClass(String classname)
Meant to be called from EntityDomain in order to update the mapping from classnames to EntityDomains.- Parameters:
classname
- the classname to unregister
-
-