Class EntityManagerManagerImpl
java.lang.Object
org.apache.tapestry5.internal.jpa.EntityManagerManagerImpl
- All Implemented Interfaces:
EventListener,ThreadCleanupListener,EntityManagerManager
public class EntityManagerManagerImpl
extends Object
implements EntityManagerManager, ThreadCleanupListener
-
Constructor Summary
ConstructorsConstructorDescriptionEntityManagerManagerImpl(EntityManagerSource entityManagerSource, org.slf4j.Logger logger) -
Method Summary
Modifier and TypeMethodDescriptionjavax.persistence.EntityManagergetEntityManager(String persistenceUnitName) Gets the active EntityManager for this request, creating it as necessary.Gets all active EntityManagers for this request, creating them as necessary.voidInvoked byPerthreadManagerservice when a thread performs and end-of-request cleanup.
-
Constructor Details
-
EntityManagerManagerImpl
-
-
Method Details
-
getEntityManager
Gets the active EntityManager for this request, creating it as necessary.- Specified by:
getEntityManagerin interfaceEntityManagerManager- Parameters:
persistenceUnitName- the name of a persistence unit as defined inpersistence.xml- Returns:
- EntityManager for the persistence unit,
-
getEntityManagers
Gets all active EntityManagers for this request, creating them as necessary.- Specified by:
getEntityManagersin interfaceEntityManagerManager- Returns:
- Map in which persistence unit names are associated with EntityManagers
-
threadDidCleanup
Description copied from interface:ThreadCleanupListenerInvoked byPerthreadManagerservice when a thread performs and end-of-request cleanup.- Specified by:
threadDidCleanupin interfaceThreadCleanupListener
-