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()
EntityManagerFactoryEntityManager.
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 EntityManagerFactorypublic EntityManager createEntityManager(Map map)
EntityManagerFactoryEntityManager 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 EntityManagerFactorymap - properties for entity managerpublic CriteriaBuilder getCriteriaBuilder()
EntityManagerFactoryCriteriaBuilder for the creation of
CriteriaQuery objects.getCriteriaBuilder in interface EntityManagerFactorypublic Metamodel getMetamodel()
EntityManagerFactoryMetamodel interface for access to the
metamodel of the persistence unit.getMetamodel in interface EntityManagerFactorypublic void close()
EntityManagerFactoryIllegalStateException, 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 EntityManagerFactorypublic Map<String,Object> getProperties()
EntityManagerFactorygetProperties in interface EntityManagerFactorypublic Cache getCache()
EntityManagerFactorygetCache in interface EntityManagerFactoryCache interfacepublic PersistenceUnitUtil getPersistenceUnitUtil()
EntityManagerFactorygetPersistenceUnitUtil in interface EntityManagerFactoryPersistenceUnitUtil interfacepublic boolean isOpen()
EntityManagerFactoryisOpen in interface EntityManagerFactorypublic SessionFactory getSessionFactory()
getSessionFactory in interface HibernateEntityManagerFactorypublic String getEntityManagerFactoryName()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.