public interface EntityManagerFactory
| 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<String,Object> map)
Create a new application-managed EntityManager with the specified Map of properties.
|
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.
|
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.
|
boolean |
isOpen()
Indicates whether the factory is open.
|
<T> T |
unwrap(Class<T> cls)
Return an object of the specified type to allow access to the provider-specific API.
|
void close()
IllegalStateException - if the entity manager factory has been closedEntityManager createEntityManager()
IllegalStateException - if the entity manager factory has been closedEntityManager createEntityManager(Map<String,Object> map)
map - properties for entity managerIllegalStateException - if the entity manager factory has been closedCache getCache()
IllegalStateException - if the entity manager factory has been closedCriteriaBuilder getCriteriaBuilder()
IllegalStateException - if the entity manager factory has been closedMetamodel getMetamodel()
IllegalStateException - if the entity manager factory has been closedPersistenceUnitUtil getPersistenceUnitUtil()
IllegalStateException - if the entity manager factory has been closedMap<String,Object> getProperties()
IllegalStateException - if the entity manager factory has been closedboolean isOpen()
<T> T unwrap(Class<T> cls)
T - the type of the classcls - the class of the object to be returned. This is normally either the underlying EntityManagerFactory implementation class
or an interface that it implements.PersistenceException - if the provider does not support the callCopyright © 2012 Batoo Software & Consultancy. All Rights Reserved.