public class EntityManagerImpl extends AbstractEntityManagerImpl implements SessionOwner
EntityManager.AbstractEntityManagerImpl.TupleBuilderTransformerHibernateEntityManagerImplementor.QueryOptions| Modifier and Type | Field and Description |
|---|---|
protected boolean |
discardOnClose |
static EntityManagerMessageLogger |
LOG |
protected boolean |
open |
protected Session |
session |
tx| Constructor and Description |
|---|
EntityManagerImpl(EntityManagerFactoryImpl entityManagerFactory,
PersistenceContextType pcType,
SynchronizationType synchronizationType,
PersistenceUnitTransactionType transactionType,
boolean discardOnClose,
Class sessionInterceptorClass,
Map properties) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkOpen() |
void |
checkOpen(boolean markForRollbackIfClosed)
Used to ensure the EntityManager is open, throwing IllegalStateException if it is closed.
|
void |
close()
Close an application-managed entity manager.
|
<T> EntityGraph<T> |
createEntityGraph(Class<T> rootType)
Return a mutable EntityGraph that can be used to dynamically create an EntityGraph.
|
EntityGraph<?> |
createEntityGraph(String graphName)
Return a mutable copy of the named EntityGraph.
|
AfterCompletionAction |
getAfterCompletionAction() |
EntityGraph<?> |
getEntityGraph(String graphName)
Return a named EntityGraph.
|
<T> List<EntityGraph<? super T>> |
getEntityGraphs(Class<T> entityClass)
Return all named EntityGraphs that have been defined for the provided class type.
|
ExceptionMapper |
getExceptionMapper() |
ManagedFlushChecker |
getManagedFlushChecker() |
protected Session |
getRawSession()
Return a Session (even if the entity manager is closed).
|
Session |
getSession()
return a Session
|
protected Session |
internalGetSession()
Return a Session without any validation checks.
|
boolean |
isOpen()
Determine whether the entity manager is open.
|
boolean |
shouldAutoCloseSession()
Should session automatically be closed after transaction completion?
|
applySavedSettings, clear, contains, convert, convert, convert, convert, createNamedJpqlQuery, createNamedQuery, createNamedQuery, createNamedSqlQuery, createNamedStoredProcedureQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, createQuery, createQuery, createQuery, createQuery, createQuery, createStoredProcedureQuery, createStoredProcedureQuery, createStoredProcedureQuery, criteriaCompiler, detach, determineAppropriateLocalCacheMode, find, find, find, find, flush, getCriteriaBuilder, getDelegate, getEntityManagerFactory, getFactory, getFlushMode, getLockMode, getLockRequest, getMetamodel, getProperties, getReference, getSynchronizationType, getTransaction, getTransactionType, handlePersistenceException, internalGetEntityManagerFactory, isJoinedToTransaction, isTransactionInProgress, joinTransaction, lock, lock, markForRollbackOnly, merge, persist, postInit, refresh, refresh, refresh, refresh, remove, resultClassChecking, resultClassChecking, setFlushMode, setProperty, throwPersistenceException, throwPersistenceException, unwrap, wrapAsJpaQuery, wrapLockException, wrapStaleStateExceptionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconvert, convert, createQuery, getLockRequest, handlePersistenceException, isTransactionInProgress, markForRollbackOnly, throwPersistenceException, throwPersistenceException, wrapStaleStateExceptiongetFactoryclear, contains, createNamedQuery, createNamedQuery, createNamedStoredProcedureQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, createQuery, createQuery, createQuery, createQuery, createStoredProcedureQuery, createStoredProcedureQuery, createStoredProcedureQuery, detach, find, find, find, find, flush, getCriteriaBuilder, getDelegate, getEntityManagerFactory, getFlushMode, getLockMode, getMetamodel, getProperties, getReference, getTransaction, isJoinedToTransaction, joinTransaction, lock, lock, merge, persist, refresh, refresh, refresh, refresh, remove, setFlushMode, setProperty, unwrappublic static final EntityManagerMessageLogger LOG
protected Session session
protected boolean open
protected boolean discardOnClose
public EntityManagerImpl(EntityManagerFactoryImpl entityManagerFactory, PersistenceContextType pcType, SynchronizationType synchronizationType, PersistenceUnitTransactionType transactionType, boolean discardOnClose, Class sessionInterceptorClass, Map properties)
protected void checkOpen()
checkOpen in class AbstractEntityManagerImplpublic void checkOpen(boolean markForRollbackIfClosed)
HibernateEntityManagerImplementormarkForRollbackIfClosed, may also rollback any enlisted-in transaction. This
distinction is made across various sections of the spec. Most failed checks should rollback. Section
3.10.7 (per 2.1 spec) lists cases related to calls on related query objects that should not rollback.checkOpen in interface HibernateEntityManagerImplementormarkForRollbackIfClosed - If the EM is closed, should the transaction (if one) be marked for rollback?public Session getSession()
AbstractEntityManagerImplgetSession in interface HibernateEntityManagergetSession in class AbstractEntityManagerImplprotected Session getRawSession()
AbstractEntityManagerImplgetRawSession in class AbstractEntityManagerImplprotected Session internalGetSession()
AbstractEntityManagerImplinternalGetSession in class AbstractEntityManagerImplpublic void close()
EntityManagerEntityManager instance and any
Query and TypedQuery
objects obtained from it will throw the IllegalStateException
except for getProperties,
getTransaction, and isOpen (which will return false).
If this method is called when the entity manager is
associated with an active transaction, the persistence
context remains managed until the transaction completes.close in interface EntityManagerpublic boolean isOpen()
EntityManagerisOpen in interface EntityManagerpublic <T> EntityGraph<T> createEntityGraph(Class<T> rootType)
EntityManagercreateEntityGraph in interface EntityManagerrootType - class of entity graphpublic EntityGraph<?> createEntityGraph(String graphName)
EntityManagercreateEntityGraph in interface EntityManagergraphName - name of an entity graphpublic EntityGraph<?> getEntityGraph(String graphName)
EntityManagergetEntityGraph in interface EntityManagergraphName - name of an existing entity graphpublic <T> List<EntityGraph<? super T>> getEntityGraphs(Class<T> entityClass)
EntityManagergetEntityGraphs in interface EntityManagerentityClass - entity classpublic boolean shouldAutoCloseSession()
SessionOwnershouldAutoCloseSession in interface SessionOwnerpublic ExceptionMapper getExceptionMapper()
getExceptionMapper in interface SessionOwnerpublic AfterCompletionAction getAfterCompletionAction()
getAfterCompletionAction in interface SessionOwnerpublic ManagedFlushChecker getManagedFlushChecker()
getManagedFlushChecker in interface SessionOwnerCopyright © 2018 JBoss by Red Hat. All rights reserved.