org.hibernate.ejb
Class EntityManagerImpl

java.lang.Object
  extended by org.hibernate.ejb.AbstractEntityManagerImpl
      extended by org.hibernate.ejb.EntityManagerImpl
All Implemented Interfaces:
Serializable, EntityManager, HibernateEntityManager, HibernateEntityManagerImplementor, SessionOwner

public class EntityManagerImpl
extends AbstractEntityManagerImpl
implements SessionOwner

Hibernate implementation of EntityManager.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.hibernate.ejb.AbstractEntityManagerImpl
AbstractEntityManagerImpl.TupleBuilderTransformer
 
Nested classes/interfaces inherited from interface org.hibernate.ejb.HibernateEntityManagerImplementor
HibernateEntityManagerImplementor.Options
 
Field Summary
protected  boolean discardOnClose
           
static EntityManagerMessageLogger LOG
           
protected  boolean open
           
protected  Session session
           
 
Fields inherited from class org.hibernate.ejb.AbstractEntityManagerImpl
persistenceContextType, tx
 
Constructor Summary
EntityManagerImpl(EntityManagerFactoryImpl entityManagerFactory, PersistenceContextType pcType, PersistenceUnitTransactionType transactionType, boolean discardOnClose, Class sessionInterceptorClass, Map properties)
           
 
Method Summary
 void close()
           
protected  Session getRawSession()
          Return a Session (even if the entity manager is closed).
 Session getSession()
          return a Session
 boolean isOpen()
           
 boolean shouldAutoCloseSession()
          Should session automatically be closed after transaction completion?
 
Methods inherited from class org.hibernate.ejb.AbstractEntityManagerImpl
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, wrapStaleStateException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final EntityManagerMessageLogger LOG

session

protected Session session

open

protected boolean open

discardOnClose

protected boolean discardOnClose
Constructor Detail

EntityManagerImpl

public EntityManagerImpl(EntityManagerFactoryImpl entityManagerFactory,
                         PersistenceContextType pcType,
                         PersistenceUnitTransactionType transactionType,
                         boolean discardOnClose,
                         Class sessionInterceptorClass,
                         Map properties)
Method Detail

getSession

public Session getSession()
Description copied from class: AbstractEntityManagerImpl
return a Session

Specified by:
getSession in interface HibernateEntityManager
Specified by:
getSession in class AbstractEntityManagerImpl
Returns:
The session

getRawSession

protected Session getRawSession()
Description copied from class: AbstractEntityManagerImpl
Return a Session (even if the entity manager is closed).

Specified by:
getRawSession in class AbstractEntityManagerImpl
Returns:
A session.

close

public void close()
Specified by:
close in interface EntityManager

isOpen

public boolean isOpen()
Specified by:
isOpen in interface EntityManager

shouldAutoCloseSession

public boolean shouldAutoCloseSession()
Description copied from interface: SessionOwner
Should session automatically be closed after transaction completion?

Specified by:
shouldAutoCloseSession in interface SessionOwner
Returns:
true/false appropriately.


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.