nl.gx.webmanager.services.entitymanager
Interface PersistenceContextEntityManager

All Superinterfaces:
EntityManager

public interface PersistenceContextEntityManager
extends EntityManager


Method Summary
<T> void
delete(T entity, PersistenceContext persistenceContext)
          Deletes an entity from the persistence backend
 java.lang.Object 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, java.lang.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(java.lang.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

java.lang.Object find(WmId primaryKey,
                      PersistenceContext persistenceContext)
Looks up an entity by its id

Parameters:
primaryKey - the id identifying the entity to load
persistenceContext -
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 persist
persistenceContext -
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 deleted
persistenceContext -
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 persist
persistenceContext -
Returns:
The entity
Throws:
DomainException - when something went wrong while saving the entity

registerEntityDomainClass

void registerEntityDomainClass(EntityDomain entityDomain,
                               java.lang.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 class
classname - the name of a Class the EntityDomain can handle

unregisterEntityDomainClass

void unregisterEntityDomainClass(java.lang.String classname)
Meant to be called from EntityDomain in order to update the mapping from classnames to EntityDomains.

Parameters:
classname - the classname to unregister


Copyright © 2007-2011 GX Software BV. All Rights Reserved.