public class EntityManagerFactoryImpl extends Object implements HibernateEntityManagerFactory
EntityManagerFactory
.Constructor and Description |
---|
EntityManagerFactoryImpl(PersistenceUnitTransactionType transactionType,
boolean discardOnClose,
Class sessionInterceptorClass,
Configuration cfg,
ServiceRegistry serviceRegistry,
String persistenceUnitName) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the factory, releasing any resources that it holds.
|
EntityManager |
createEntityManager()
Create a new application-managed
EntityManager . |
EntityManager |
createEntityManager(Map map)
Create a new application-managed
EntityManager with the
specified Map of properties. |
protected org.hibernate.ejb.EntityManagerFactoryImpl.JpaMetaModelPopulationSetting |
determineJpaMetaModelPopulationSetting(Configuration cfg) |
Cache |
getCache()
Access the cache that is associated with the entity manager
factory (the "second level cache").
|
CriteriaBuilder |
getCriteriaBuilder()
Return an instance of
CriteriaBuilder for the creation of
CriteriaQuery objects. |
String |
getEntityManagerFactoryName() |
Metamodel |
getMetamodel()
Return an instance of
Metamodel interface for access to the
metamodel of the persistence unit. |
PersistenceUnitUtil |
getPersistenceUnitUtil()
Return interface providing access to utility methods
for the persistence unit.
|
Map<String,Object> |
getProperties()
Get the properties and associated values that are in effect
for the entity manager factory.
|
SessionFactory |
getSessionFactory() |
boolean |
isOpen()
Indicates whether the factory is open.
|
public EntityManagerFactoryImpl(PersistenceUnitTransactionType transactionType, boolean discardOnClose, Class sessionInterceptorClass, Configuration cfg, ServiceRegistry serviceRegistry, String persistenceUnitName)
protected org.hibernate.ejb.EntityManagerFactoryImpl.JpaMetaModelPopulationSetting determineJpaMetaModelPopulationSetting(Configuration cfg)
public EntityManager createEntityManager()
EntityManagerFactory
EntityManager
.
This method returns a new EntityManager
instance each time
it is invoked.
The isOpen
method will return true on the returned instance.createEntityManager
in interface EntityManagerFactory
public EntityManager createEntityManager(Map map)
EntityManagerFactory
EntityManager
with the
specified Map of properties.
This method returns a new EntityManager
instance each time
it is invoked.
The isOpen
method will return true on the returned instance.createEntityManager
in interface EntityManagerFactory
map
- properties for entity managerpublic CriteriaBuilder getCriteriaBuilder()
EntityManagerFactory
CriteriaBuilder
for the creation of
CriteriaQuery
objects.getCriteriaBuilder
in interface EntityManagerFactory
public Metamodel getMetamodel()
EntityManagerFactory
Metamodel
interface for access to the
metamodel of the persistence unit.getMetamodel
in interface EntityManagerFactory
public void close()
EntityManagerFactory
IllegalStateException
, except
for isOpen
, which will return false. Once an
EntityManagerFactory
has been closed, all its
entity managers are considered to be in the closed state.close
in interface EntityManagerFactory
public Map<String,Object> getProperties()
EntityManagerFactory
getProperties
in interface EntityManagerFactory
public Cache getCache()
EntityManagerFactory
getCache
in interface EntityManagerFactory
Cache
interfacepublic PersistenceUnitUtil getPersistenceUnitUtil()
EntityManagerFactory
getPersistenceUnitUtil
in interface EntityManagerFactory
PersistenceUnitUtil
interfacepublic boolean isOpen()
EntityManagerFactory
isOpen
in interface EntityManagerFactory
public SessionFactory getSessionFactory()
getSessionFactory
in interface HibernateEntityManagerFactory
public String getEntityManagerFactoryName()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.