public class EntityManagerImpl extends AbstractEntityManagerImpl implements SessionOwner
EntityManager
.AbstractEntityManagerImpl.TupleBuilderTransformer
HibernateEntityManagerImplementor.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() |
<T> EntityGraph<T> |
createEntityGraph(Class<T> rootType) |
EntityGraph<?> |
createEntityGraph(String graphName) |
EntityGraph<?> |
getEntityGraph(String graphName) |
<T> List<EntityGraph<? super T>> |
getEntityGraphs(Class<T> entityClass) |
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() |
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, 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, wrapStaleStateException
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convert, convert, createQuery, getLockRequest, handlePersistenceException, isTransactionInProgress, markForRollbackOnly, throwPersistenceException, throwPersistenceException, wrapStaleStateException
getFactory
clear, 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, unwrap
public 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 AbstractEntityManagerImpl
public void checkOpen(boolean markForRollbackIfClosed)
HibernateEntityManagerImplementor
markForRollbackIfClosed
, 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 HibernateEntityManagerImplementor
markForRollbackIfClosed
- If the EM is closed, should the transaction (if one) be marked for rollback?public Session getSession()
AbstractEntityManagerImpl
getSession
in interface HibernateEntityManager
getSession
in class AbstractEntityManagerImpl
protected Session getRawSession()
AbstractEntityManagerImpl
getRawSession
in class AbstractEntityManagerImpl
protected Session internalGetSession()
AbstractEntityManagerImpl
internalGetSession
in class AbstractEntityManagerImpl
public void close()
close
in interface EntityManager
public boolean isOpen()
isOpen
in interface EntityManager
public <T> EntityGraph<T> createEntityGraph(Class<T> rootType)
createEntityGraph
in interface EntityManager
public EntityGraph<?> createEntityGraph(String graphName)
createEntityGraph
in interface EntityManager
public EntityGraph<?> getEntityGraph(String graphName)
getEntityGraph
in interface EntityManager
public <T> List<EntityGraph<? super T>> getEntityGraphs(Class<T> entityClass)
getEntityGraphs
in interface EntityManager
public boolean shouldAutoCloseSession()
SessionOwner
shouldAutoCloseSession
in interface SessionOwner
Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.