javax.persistence.EntityManagerFactory - JPA interface
javax.persistence
Interface EntityManagerFactory
When the application has finished using the entity manager factory, and/or at application shutdown, the application should close the entity manager factory. Once an EntityManagerFactory
has been closed, all its entity managers are considered to be in the closed state.
- Since:
- JPA 1.0
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.
- Throws:
-
IllegalStateException
- if the entity manager factory has been closed
- Since:
- JPA 1.0
EntityManager
. This method returns a new
EntityManager
instance each time it is invoked. The
isOpen
method will return true on the returned instance.
- Returns:
- entity manager instance
- Throws:
-
IllegalStateException
- if the entity manager factory has been closed
- Since:
- JPA 1.0
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.
- Parameters:
-
map
- properties for entity manager
- Returns:
- entity manager instance
- Throws:
-
IllegalStateException
- if the entity manager factory has been closed
- Since:
- JPA 1.0
- Returns:
-
instance of the
Cache
interface
- Throws:
-
IllegalStateException
- if the entity manager factory has been closed
- Since:
- JPA 2.0
CriteriaBuilder
for the creation of
CriteriaQuery
objects.
- Returns:
- CriteriaBuilder instance
- Throws:
-
IllegalStateException
- if the entity manager factory has been closed
- Since:
- JPA 2.0
Metamodel
interface for access to the metamodel of the persistence unit.
- Returns:
- Metamodel instance
- Throws:
-
IllegalStateException
- if the entity manager factory has been closed
- Since:
- JPA 2.0
- Returns:
-
PersistenceUnitUtil
interface
- Throws:
-
IllegalStateException
- if the entity manager factory has been closed
- Since:
- JPA 2.0
- Returns:
- properties
- Throws:
-
IllegalStateException
- if the entity manager factory has been closed
- Since:
- JPA 2.0
- Returns:
- boolean indicating whether the factory is open
- Since:
- JPA 1.0