|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.jpa.EntityManagerFactoryImpl
public class EntityManagerFactoryImpl
EntityManagerFactory implementation. Caches the "persistence-unit" MetaData information when encountered (in J2SE mode). TODO Change to extend ObjectManagerFactoryImpl and remove PMF reference.
| Field Summary | |
|---|---|
protected static org.datanucleus.util.Localiser |
LOCALISER
Localiser for messages. |
static org.datanucleus.util.NucleusLogger |
LOGGER
Logger for enhancing. |
protected org.datanucleus.jdo.JDOPersistenceManagerFactory |
pmf
Underlying PersistenceManagerFactory that provides the persistence functionality. |
| Constructor Summary | |
|---|---|
EntityManagerFactoryImpl()
Constructor. |
|
EntityManagerFactoryImpl(javax.persistence.spi.PersistenceUnitInfo unitInfo,
java.util.Map overridingProps)
Constructor when working in a J2EE environment. |
|
EntityManagerFactoryImpl(java.lang.String unitName,
java.util.Map overridingProps)
Constructor when working in a J2SE environment. |
|
| Method Summary | |
|---|---|
protected void |
assertIsClosed()
|
void |
close()
Method to close the factory. |
javax.persistence.EntityManager |
createEntityManager()
Method to create an entity manager. |
javax.persistence.EntityManager |
createEntityManager(java.util.Map overridingProps)
Method to create an entity manager with the specified properties. |
javax.persistence.Cache |
getCache()
Accessor for the second level cache. |
javax.persistence.criteria.CriteriaBuilder |
getCriteriaBuilder()
|
java.lang.Object |
getIdentifier(java.lang.Object entity)
|
javax.persistence.metamodel.Metamodel |
getMetamodel()
|
javax.persistence.PersistenceUnitUtil |
getPersistenceUnitUtil()
|
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Get the properties and associated values that are in effect for the entity manager factory. |
JPAQueryCache |
getQueryCache()
Accessor for the query results cache. |
org.datanucleus.store.query.cache.QueryDatastoreCompilationCache |
getQueryDatastoreCompilationCache()
Accessor for the query datastore compilation cache. |
org.datanucleus.query.cache.QueryCompilationCache |
getQueryGenericCompilationCache()
Accessor for the query generic compilation cache. |
java.util.Set<java.lang.String> |
getSupportedProperties()
Get the names of the properties that are supported for use with the entity manager factory. |
protected org.datanucleus.jdo.JDOPersistenceManagerFactory |
initialisePMF(org.datanucleus.metadata.PersistenceUnitMetaData unitMetaData,
java.util.Map overridingProps)
Method to initialise a PersistenceManagerFactory that will control the persistence. |
boolean |
isContainerManaged()
Accessor for whether the EMF is managed by a container. |
boolean |
isLoaded(java.lang.Object entity)
|
boolean |
isLoaded(java.lang.Object entity,
java.lang.String attrName)
|
boolean |
isOpen()
Accessor for whether the factory is open |
protected javax.persistence.EntityManager |
newEntityManager(javax.persistence.PersistenceContextType contextType,
javax.jdo.PersistenceManagerFactory pmf)
Creates an EntityManager. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.datanucleus.util.Localiser LOCALISER
public static final org.datanucleus.util.NucleusLogger LOGGER
protected org.datanucleus.jdo.JDOPersistenceManagerFactory pmf
| Constructor Detail |
|---|
public EntityManagerFactoryImpl()
public EntityManagerFactoryImpl(javax.persistence.spi.PersistenceUnitInfo unitInfo,
java.util.Map overridingProps)
unitInfo - The "persistent-unit" infooverridingProps - factory properties overriding those in the "persistence-unit"
public EntityManagerFactoryImpl(java.lang.String unitName,
java.util.Map overridingProps)
unitName - Name of the "persistent-unit" to useoverridingProps - factory properties overriding those in the "persistence-unit"| Method Detail |
|---|
public boolean isContainerManaged()
public void close()
close in interface javax.persistence.EntityManagerFactorypublic boolean isOpen()
isOpen in interface javax.persistence.EntityManagerFactorypublic JPAQueryCache getQueryCache()
public org.datanucleus.query.cache.QueryCompilationCache getQueryGenericCompilationCache()
public org.datanucleus.store.query.cache.QueryDatastoreCompilationCache getQueryDatastoreCompilationCache()
public javax.persistence.EntityManager createEntityManager()
createEntityManager in interface javax.persistence.EntityManagerFactorypublic javax.persistence.EntityManager createEntityManager(java.util.Map overridingProps)
createEntityManager in interface javax.persistence.EntityManagerFactoryoverridingProps - Properties to use for this manager
protected javax.persistence.EntityManager newEntityManager(javax.persistence.PersistenceContextType contextType,
javax.jdo.PersistenceManagerFactory pmf)
EntityManager.
Override if you want to return a different type that implements this interface.
contextType - The persistence context typepmf - The Underlying PMF
protected org.datanucleus.jdo.JDOPersistenceManagerFactory initialisePMF(org.datanucleus.metadata.PersistenceUnitMetaData unitMetaData,
java.util.Map overridingProps)
unitMetaData - The "persistence-unit" metadata (if any)overridingProps - Properties to override all others
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
getProperties in interface javax.persistence.EntityManagerFactorypublic java.util.Set<java.lang.String> getSupportedProperties()
protected void assertIsClosed()
public javax.persistence.Cache getCache()
getCache in interface javax.persistence.EntityManagerFactorypublic javax.persistence.metamodel.Metamodel getMetamodel()
getMetamodel in interface javax.persistence.EntityManagerFactorypublic javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
getCriteriaBuilder in interface javax.persistence.EntityManagerFactorypublic javax.persistence.PersistenceUnitUtil getPersistenceUnitUtil()
getPersistenceUnitUtil in interface javax.persistence.EntityManagerFactorypublic java.lang.Object getIdentifier(java.lang.Object entity)
getIdentifier in interface javax.persistence.PersistenceUnitUtil
public boolean isLoaded(java.lang.Object entity,
java.lang.String attrName)
isLoaded in interface javax.persistence.PersistenceUnitUtilisLoaded in interface javax.persistence.PersistenceUtilpublic boolean isLoaded(java.lang.Object entity)
isLoaded in interface javax.persistence.PersistenceUnitUtilisLoaded in interface javax.persistence.PersistenceUtil
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||