public class EntityManagerImpl extends AbstractEntityManagerImpl implements SessionOwner
EntityManager.AbstractEntityManagerImpl.TupleBuilderTransformerHibernateEntityManagerImplementor.Options| Modifier and Type | Field and Description |
|---|---|
protected boolean |
discardOnClose |
static EntityManagerMessageLogger |
LOG |
protected boolean |
open |
protected Session |
session |
persistenceContextType, tx| Constructor and Description |
|---|
EntityManagerImpl(EntityManagerFactoryImpl entityManagerFactory,
PersistenceContextType pcType,
PersistenceUnitTransactionType transactionType,
boolean discardOnClose,
Class sessionInterceptorClass,
Map properties) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close an application-managed entity manager.
|
protected Session |
getRawSession()
Return a Session (even if the entity manager is closed).
|
Session |
getSession()
return a Session
|
boolean |
isOpen()
Determine whether the entity manager is open.
|
boolean |
shouldAutoCloseSession()
Should session automatically be closed after transaction completion?
|
clear, contains, convert, convert, convert, createNamedQuery, createNamedQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, createQuery, createQuery, createQuery, detach, determineAppropriateLocalCacheMode, find, find, find, find, flush, getCriteriaBuilder, getDelegate, getEntityManagerFactory, getFactory, getFlushMode, getLockMode, getLockRequest, getMetamodel, getProperties, getReference, getTransaction, getTransactionType, handlePersistenceException, isTransactionInProgress, joinTransaction, lock, lock, markAsRollback, merge, persist, postInit, refresh, refresh, refresh, refresh, remove, setFlushMode, setProperty, throwPersistenceException, throwPersistenceException, unwrap, wrapLockException, wrapStaleStateExceptionpublic static final EntityManagerMessageLogger LOG
protected Session session
protected boolean open
protected boolean discardOnClose
public EntityManagerImpl(EntityManagerFactoryImpl entityManagerFactory, PersistenceContextType pcType, PersistenceUnitTransactionType transactionType, boolean discardOnClose, Class sessionInterceptorClass, Map properties)
public Session getSession()
AbstractEntityManagerImplgetSession in interface HibernateEntityManagergetSession in class AbstractEntityManagerImplprotected Session getRawSession()
AbstractEntityManagerImplgetRawSession 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 boolean shouldAutoCloseSession()
SessionOwnershouldAutoCloseSession in interface SessionOwnerCopyright © 2018 JBoss by Red Hat. All rights reserved.