public class JPAEntityManagerFactory extends Object implements javax.persistence.EntityManagerFactory, javax.persistence.PersistenceUnitUtil
| Modifier and Type | Field and Description |
|---|---|
protected static org.datanucleus.util.Localiser |
LOCALISER
Localiser for messages.
|
static org.datanucleus.util.NucleusLogger |
LOGGER
Logger for enhancing.
|
| Constructor and Description |
|---|
JPAEntityManagerFactory()
Constructor.
|
JPAEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo unitInfo,
Map overridingProps)
Constructor when working in a J2EE environment.
|
JPAEntityManagerFactory(org.datanucleus.metadata.PersistenceUnitMetaData pumd,
Map overridingProps)
Convenience constructor to allow for dynamic persistence-unit creation.
|
JPAEntityManagerFactory(String unitName,
Map overridingProps)
Constructor when working in a J2SE environment.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertIsClosed() |
void |
close()
Method to close the factory.
|
javax.persistence.EntityManager |
createEntityManager()
Method to create an entity manager.
|
javax.persistence.EntityManager |
createEntityManager(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() |
Object |
getIdentifier(Object entity) |
javax.persistence.metamodel.Metamodel |
getMetamodel() |
org.datanucleus.NucleusContext |
getNucleusContext() |
javax.persistence.PersistenceUnitUtil |
getPersistenceUnitUtil() |
Map<String,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.
|
Set<String> |
getSupportedProperties()
Get the names of the properties that are supported for use with the entity manager factory.
|
protected org.datanucleus.NucleusContext |
initialiseNucleusContext(org.datanucleus.metadata.PersistenceUnitMetaData unitMetaData,
Map overridingProps,
org.datanucleus.plugin.PluginManager pluginMgr)
Method to initialise a PersistenceManagerFactory that will control the persistence.
|
boolean |
isContainerManaged()
Accessor for whether the EMF is managed by a container.
|
boolean |
isLoaded(Object entity) |
boolean |
isLoaded(Object entity,
String attrName) |
boolean |
isOpen()
Accessor for whether the factory is open
|
protected javax.persistence.EntityManager |
newEntityManager(org.datanucleus.NucleusContext nucleusCtx,
javax.persistence.PersistenceContextType contextType)
Creates an
EntityManager. |
<T> T |
unwrap(Class<T> cls)
Return an object of the specified type to allow access to the provider-specific API.
|
protected static final org.datanucleus.util.Localiser LOCALISER
public static final org.datanucleus.util.NucleusLogger LOGGER
public JPAEntityManagerFactory()
public JPAEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo unitInfo,
Map overridingProps)
unitInfo - The "persistent-unit" infooverridingProps - factory properties overriding those in the "persistence-unit"public JPAEntityManagerFactory(org.datanucleus.metadata.PersistenceUnitMetaData pumd,
Map overridingProps)
pumd - Persistence unit metadataoverridingProps - Properties overriding those defined for this unitpublic org.datanucleus.NucleusContext getNucleusContext()
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(Map overridingProps)
createEntityManager in interface javax.persistence.EntityManagerFactoryoverridingProps - Properties to use for this managerprotected javax.persistence.EntityManager newEntityManager(org.datanucleus.NucleusContext nucleusCtx,
javax.persistence.PersistenceContextType contextType)
EntityManager.
Override if you want to return a different type that implements this interface.nucleusCtx - Nucleus ContextcontextType - The persistence context typeprotected org.datanucleus.NucleusContext initialiseNucleusContext(org.datanucleus.metadata.PersistenceUnitMetaData unitMetaData,
Map overridingProps,
org.datanucleus.plugin.PluginManager pluginMgr)
unitMetaData - The "persistence-unit" metadata (if any)overridingProps - Properties to override all otherspublic Map<String,Object> getProperties()
getProperties in interface javax.persistence.EntityManagerFactorypublic Set<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 Object getIdentifier(Object entity)
getIdentifier in interface javax.persistence.PersistenceUnitUtilpublic boolean isLoaded(Object entity, String attrName)
isLoaded in interface javax.persistence.PersistenceUnitUtilisLoaded in interface javax.persistence.PersistenceUtilpublic boolean isLoaded(Object entity)
isLoaded in interface javax.persistence.PersistenceUnitUtilisLoaded in interface javax.persistence.PersistenceUtilpublic <T> T unwrap(Class<T> cls)
cls - the class of the object to be returned. This is normally either the underlying
EntityManagerFactory implementation class or an interface that it implements.javax.persistence.PersistenceException - if the provider does not support the call.Copyright © 2012. All Rights Reserved.