public class EntityManagerFactoryImpl extends Object implements OpenJPAEntityManagerFactory, OpenJPAEntityManagerFactorySPI, Closeable, PersistenceUnitUtil
EntityManagerFactory that acts as a
facade to a BrokerFactory.CONN_RETAIN_ALWAYS, CONN_RETAIN_DEMAND, CONN_RETAIN_TRANS| Constructor and Description |
|---|
EntityManagerFactoryImpl()
Default constructor provided for auto-instantiation.
|
EntityManagerFactoryImpl(BrokerFactory factory)
Supply delegate on construction.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLifecycleListener(Object listener,
Class... classes)
Register a listener for lifecycle-related events on the specified
classes.
|
void |
addTransactionListener(Object listener)
Register a listener for transaction-related events on the specified
classes.
|
void |
close() |
OpenJPAEntityManagerSPI |
createEntityManager() |
OpenJPAEntityManagerSPI |
createEntityManager(Map props)
Creates and configures a entity manager with the given properties.
|
boolean |
equals(Object other) |
BrokerFactory |
getBrokerFactory()
Delegate.
|
Cache |
getCache() |
OpenJPAConfiguration |
getConfiguration()
Return the configuration for this factory.
|
OpenJPACriteriaBuilder |
getCriteriaBuilder()
Gets the QueryBuilder with OpenJPA-extended capabilities.
|
OpenJPAQueryBuilder |
getDynamicQueryBuilder()
Gets a builder for dynamic queries.
|
Object |
getIdentifier(Object entity)
Get the identifier for the specified entity.
|
MetamodelImpl |
getMetamodel() |
PersistenceUnitUtil |
getPersistenceUnitUtil() |
Map<String,Object> |
getProperties()
Return properties describing this runtime.
|
QueryResultCache |
getQueryResultCache()
Access query result cache.
|
StoreCache |
getStoreCache()
Access the level 2 store cache.
|
StoreCache |
getStoreCache(String cacheName)
Access a named level 2 store cache.
|
Set<String> |
getSupportedProperties()
Get the properties supported by this runtime.
|
Object |
getUserObject(Object key)
Get the value for the specified key from the map of user objects.
|
int |
hashCode() |
boolean |
isLoaded(Object entity) |
boolean |
isLoaded(Object entity,
String attribute) |
boolean |
isOpen() |
protected EntityManagerImpl |
newEntityManagerImpl(Broker broker)
Create a new entity manager around the given broker.
|
Object |
putUserObject(Object key,
Object val)
Put the specified key-value pair into the map of user objects.
|
void |
removeLifecycleListener(Object listener)
Remove a listener for lifecycle-related events.
|
void |
removeTransactionListener(Object listener)
Remove a listener for transaction-related events.
|
void |
setBrokerFactory(BrokerFactory factory)
Delegate must be provided before use.
|
public EntityManagerFactoryImpl()
public EntityManagerFactoryImpl(BrokerFactory factory)
public BrokerFactory getBrokerFactory()
public void setBrokerFactory(BrokerFactory factory)
public OpenJPAConfiguration getConfiguration()
OpenJPAEntityManagerFactorySPIgetConfiguration in interface OpenJPAEntityManagerFactorygetConfiguration in interface OpenJPAEntityManagerFactorySPIpublic Map<String,Object> getProperties()
OpenJPAEntityManagerFactorygetProperties in interface EntityManagerFactorygetProperties in interface OpenJPAEntityManagerFactorypublic Object putUserObject(Object key, Object val)
OpenJPAEntityManagerFactoryputUserObject in interface OpenJPAEntityManagerFactorypublic Object getUserObject(Object key)
OpenJPAEntityManagerFactorygetUserObject in interface OpenJPAEntityManagerFactorypublic StoreCache getStoreCache()
OpenJPAEntityManagerFactorygetStoreCache in interface OpenJPAEntityManagerFactorypublic StoreCache getStoreCache(String cacheName)
OpenJPAEntityManagerFactorygetStoreCache in interface OpenJPAEntityManagerFactorypublic QueryResultCache getQueryResultCache()
OpenJPAEntityManagerFactorygetQueryResultCache in interface OpenJPAEntityManagerFactorypublic OpenJPAEntityManagerSPI createEntityManager()
createEntityManager in interface EntityManagerFactorycreateEntityManager in interface OpenJPAEntityManagerFactorycreateEntityManager in interface OpenJPAEntityManagerFactorySPIpublic OpenJPAEntityManagerSPI createEntityManager(Map props)
createEntityManager in interface EntityManagerFactorycreateEntityManager in interface OpenJPAEntityManagerFactorycreateEntityManager in interface OpenJPAEntityManagerFactorySPIprotected EntityManagerImpl newEntityManagerImpl(Broker broker)
public void addLifecycleListener(Object listener, Class... classes)
OpenJPAEntityManagerFactorySPIorg.apache.openjpa.event package for
listener types.addLifecycleListener in interface OpenJPAEntityManagerFactoryaddLifecycleListener in interface OpenJPAEntityManagerFactorySPIpublic void removeLifecycleListener(Object listener)
OpenJPAEntityManagerFactorySPIremoveLifecycleListener in interface OpenJPAEntityManagerFactoryremoveLifecycleListener in interface OpenJPAEntityManagerFactorySPIpublic void addTransactionListener(Object listener)
OpenJPAEntityManagerFactorySPIorg.apache.openjpa.event package for
listener types.addTransactionListener in interface OpenJPAEntityManagerFactoryaddTransactionListener in interface OpenJPAEntityManagerFactorySPIpublic void removeTransactionListener(Object listener)
OpenJPAEntityManagerFactorySPIremoveTransactionListener in interface OpenJPAEntityManagerFactoryremoveTransactionListener in interface OpenJPAEntityManagerFactorySPIpublic void close()
close in interface EntityManagerFactoryclose in interface Closeablepublic boolean isOpen()
isOpen in interface EntityManagerFactorypublic Cache getCache()
getCache in interface EntityManagerFactorypublic OpenJPACriteriaBuilder getCriteriaBuilder()
OpenJPAEntityManagerFactorygetCriteriaBuilder in interface EntityManagerFactorygetCriteriaBuilder in interface OpenJPAEntityManagerFactorypublic OpenJPAQueryBuilder getDynamicQueryBuilder()
OpenJPAEntityManagerFactorygetDynamicQueryBuilder in interface OpenJPAEntityManagerFactorypublic Set<String> getSupportedProperties()
OpenJPAEntityManagerFactorygetSupportedProperties in interface OpenJPAEntityManagerFactorypublic MetamodelImpl getMetamodel()
getMetamodel in interface EntityManagerFactorypublic PersistenceUnitUtil getPersistenceUnitUtil()
getPersistenceUnitUtil in interface EntityManagerFactorypublic Object getIdentifier(Object entity)
getIdentifier in interface PersistenceUnitUtilpublic boolean isLoaded(Object entity)
isLoaded in interface PersistenceUnitUtilisLoaded in interface PersistenceUtilpublic boolean isLoaded(Object entity, String attribute)
isLoaded in interface PersistenceUnitUtilisLoaded in interface PersistenceUtilCopyright © 2006–2017 Apache Software Foundation. All rights reserved.