Class EntityManagerSourceImpl
- java.lang.Object
-
- org.apache.tapestry5.internal.jpa.EntityManagerSourceImpl
-
- All Implemented Interfaces:
EntityManagerSource
public class EntityManagerSourceImpl extends java.lang.Object implements EntityManagerSource
-
-
Constructor Summary
Constructors Constructor Description EntityManagerSourceImpl(org.slf4j.Logger logger, Resource persistenceDescriptor, PersistenceUnitConfigurer packageNamePersistenceUnitConfigurer, java.util.Map<java.lang.String,PersistenceUnitConfigurer> configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EntityManager
create(java.lang.String persistenceUnitName)
Creates an EntityManager for the given persistence unit name.EntityManagerFactory
getEntityManagerFactory(java.lang.String persistenceUnitName)
Gets the EntityManagerFactory for the given persistence unit name, creating it as necessary.java.util.List<PersistenceUnitInfo>
getPersistenceUnitInfos()
Get the list of PersistenceUnitInfo parsed frompersistence.xml
.void
listenForShutdown(RegistryShutdownHub hub)
-
-
-
Constructor Detail
-
EntityManagerSourceImpl
public EntityManagerSourceImpl(org.slf4j.Logger logger, @Symbol("tapestry.jpa.persistence-descriptor") Resource persistenceDescriptor, @Local PersistenceUnitConfigurer packageNamePersistenceUnitConfigurer, java.util.Map<java.lang.String,PersistenceUnitConfigurer> configuration)
-
-
Method Detail
-
listenForShutdown
@PostInjection public void listenForShutdown(RegistryShutdownHub hub)
-
getEntityManagerFactory
public EntityManagerFactory getEntityManagerFactory(java.lang.String persistenceUnitName)
Gets the EntityManagerFactory for the given persistence unit name, creating it as necessary.- Specified by:
getEntityManagerFactory
in interfaceEntityManagerSource
- Parameters:
persistenceUnitName
- the name of a persistence unit as defined inpersistence.xml
- Returns:
- EntityManagerFactory for the given persistence unit name
-
create
public EntityManager create(java.lang.String persistenceUnitName)
Description copied from interface:EntityManagerSource
Creates an EntityManager for the given persistence unit name.- Specified by:
create
in interfaceEntityManagerSource
- Parameters:
persistenceUnitName
- the name of a persistence unit as defined inpersistence.xml
- Returns:
- EntityManager for the given persistence unit name
-
getPersistenceUnitInfos
public java.util.List<PersistenceUnitInfo> getPersistenceUnitInfos()
Description copied from interface:EntityManagerSource
Get the list of PersistenceUnitInfo parsed frompersistence.xml
.- Specified by:
getPersistenceUnitInfos
in interfaceEntityManagerSource
- Returns:
- list of PersistenceUnitInfos
-
-