|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.ejb.AbstractEntityManagerImpl
public abstract class AbstractEntityManagerImpl
Nested Class Summary | |
---|---|
static class |
AbstractEntityManagerImpl.TupleBuilderTransformer
|
Nested classes/interfaces inherited from interface org.hibernate.ejb.HibernateEntityManagerImplementor |
---|
HibernateEntityManagerImplementor.Options |
Field Summary | |
---|---|
protected PersistenceContextType |
persistenceContextType
|
protected TransactionImpl |
tx
|
Constructor Summary | |
---|---|
protected |
AbstractEntityManagerImpl(EntityManagerFactoryImpl entityManagerFactory,
PersistenceContextType type,
PersistenceUnitTransactionType transactionType,
Map properties)
|
Method Summary | ||
---|---|---|
void |
clear()
|
|
boolean |
contains(Object entity)
|
|
RuntimeException |
convert(HibernateException e)
Converts a Hibernate-specific exception into a JPA-specified exception; note that the JPA sepcification makes use of exceptions outside its exception hierarchy, though they are all runtime exceptions. |
|
RuntimeException |
convert(HibernateException e,
LockOptions lockOptions)
Converts a Hibernate-specific exception into a JPA-specified exception; note that the JPA sepcification makes use of exceptions outside its exception hierarchy, though they are all runtime exceptions. |
|
RuntimeException |
convert(RuntimeException e)
|
|
Query |
createNamedQuery(String name)
|
|
|
createNamedQuery(String name,
Class<T> resultClass)
|
|
Query |
createNativeQuery(String sqlString)
|
|
Query |
createNativeQuery(String sqlString,
Class resultClass)
|
|
Query |
createNativeQuery(String sqlString,
String resultSetMapping)
|
|
|
createQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
|
|
Query |
createQuery(String jpaqlString)
|
|
|
createQuery(String jpaqlString,
Class<T> resultClass)
|
|
|
createQuery(String jpaqlString,
Class<T> resultClass,
javax.persistence.criteria.Selection selection,
HibernateEntityManagerImplementor.Options options)
Used during "compiling" a JPA criteria query. |
|
void |
detach(Object entity)
|
|
CacheMode |
determineAppropriateLocalCacheMode(Map<String,Object> localProperties)
|
|
|
find(Class<A> entityClass,
Object primaryKey)
|
|
|
find(Class<A> entityClass,
Object primaryKey,
LockModeType lockModeType)
|
|
|
find(Class<A> entityClass,
Object primaryKey,
LockModeType lockModeType,
Map<String,Object> properties)
|
|
|
find(Class<T> entityClass,
Object primaryKey,
Map<String,Object> properties)
|
|
void |
flush()
|
|
javax.persistence.criteria.CriteriaBuilder |
getCriteriaBuilder()
|
|
Object |
getDelegate()
returns the underlying session |
|
EntityManagerFactoryImpl |
getEntityManagerFactory()
|
|
HibernateEntityManagerFactory |
getFactory()
Get access to the Hibernate extended EMF contract. |
|
FlushModeType |
getFlushMode()
Hibernate can be set in various flush modes that are unknown to JPA 2.0. |
|
LockModeType |
getLockMode(Object entity)
|
|
LockOptions |
getLockRequest(LockModeType lockModeType,
Map<String,Object> properties)
Convert from JPA 2 LockModeType & properties into LockOptions |
|
javax.persistence.metamodel.Metamodel |
getMetamodel()
|
|
Map<String,Object> |
getProperties()
|
|
protected abstract Session |
getRawSession()
Return a Session (even if the entity manager is closed). |
|
|
getReference(Class<T> entityClass,
Object primaryKey)
|
|
abstract Session |
getSession()
return a Session |
|
EntityTransaction |
getTransaction()
|
|
void |
handlePersistenceException(PersistenceException e)
Handles marking for rollback and other such operations that need to occur depending on the type of exception being handled. |
|
boolean |
isTransactionInProgress()
Provides access to whether a transaction is currently in progress. |
|
void |
joinTransaction()
|
|
void |
lock(Object entity,
LockModeType lockMode)
|
|
void |
lock(Object entity,
LockModeType lockModeType,
Map<String,Object> properties)
|
|
protected void |
markAsRollback()
|
|
|
merge(A entity)
|
|
void |
persist(Object entity)
|
|
protected void |
postInit()
|
|
void |
refresh(Object entity)
|
|
void |
refresh(Object entity,
LockModeType lockModeType)
|
|
void |
refresh(Object entity,
LockModeType lockModeType,
Map<String,Object> properties)
|
|
void |
refresh(Object entity,
Map<String,Object> properties)
|
|
void |
remove(Object entity)
|
|
void |
setFlushMode(FlushModeType flushModeType)
|
|
void |
setProperty(String s,
Object o)
|
|
void |
throwPersistenceException(HibernateException e)
Delegates to HibernateEntityManagerImplementor.convert(org.hibernate.HibernateException, org.hibernate.LockOptions) and then throws the given exception. |
|
void |
throwPersistenceException(PersistenceException e)
Delegates to HibernateEntityManagerImplementor.handlePersistenceException(javax.persistence.PersistenceException) and then throws the given exception. |
|
|
unwrap(Class<T> clazz)
|
|
PersistenceException |
wrapLockException(HibernateException e,
LockOptions lockOptions)
|
|
PersistenceException |
wrapStaleStateException(StaleStateException e)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.persistence.EntityManager |
---|
close, isOpen |
Field Detail |
---|
protected transient TransactionImpl tx
protected PersistenceContextType persistenceContextType
Constructor Detail |
---|
protected AbstractEntityManagerImpl(EntityManagerFactoryImpl entityManagerFactory, PersistenceContextType type, PersistenceUnitTransactionType transactionType, Map properties)
Method Detail |
---|
protected void postInit()
public Query createQuery(String jpaqlString)
createQuery
in interface EntityManager
public <T> TypedQuery<T> createQuery(String jpaqlString, Class<T> resultClass)
createQuery
in interface EntityManager
public <T> TypedQuery<T> createQuery(String jpaqlString, Class<T> resultClass, javax.persistence.criteria.Selection selection, HibernateEntityManagerImplementor.Options options)
HibernateEntityManagerImplementor
createQuery
in interface HibernateEntityManagerImplementor
T
- The query typejpaqlString
- The criteria query rendered as a JPA QL stringresultClass
- The result type (the type expected in the result list)selection
- The selection(s)options
- The options to use to build the query.
public <T> TypedQuery<T> createQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
createQuery
in interface EntityManager
public Query createNamedQuery(String name)
createNamedQuery
in interface EntityManager
public <T> TypedQuery<T> createNamedQuery(String name, Class<T> resultClass)
createNamedQuery
in interface EntityManager
public Query createNativeQuery(String sqlString)
createNativeQuery
in interface EntityManager
public Query createNativeQuery(String sqlString, Class resultClass)
createNativeQuery
in interface EntityManager
public Query createNativeQuery(String sqlString, String resultSetMapping)
createNativeQuery
in interface EntityManager
public <T> T getReference(Class<T> entityClass, Object primaryKey)
getReference
in interface EntityManager
public <A> A find(Class<A> entityClass, Object primaryKey)
find
in interface EntityManager
public <T> T find(Class<T> entityClass, Object primaryKey, Map<String,Object> properties)
find
in interface EntityManager
public <A> A find(Class<A> entityClass, Object primaryKey, LockModeType lockModeType)
find
in interface EntityManager
public <A> A find(Class<A> entityClass, Object primaryKey, LockModeType lockModeType, Map<String,Object> properties)
find
in interface EntityManager
public CacheMode determineAppropriateLocalCacheMode(Map<String,Object> localProperties)
public void persist(Object entity)
persist
in interface EntityManager
public <A> A merge(A entity)
merge
in interface EntityManager
public void remove(Object entity)
remove
in interface EntityManager
public void refresh(Object entity)
refresh
in interface EntityManager
public void refresh(Object entity, Map<String,Object> properties)
refresh
in interface EntityManager
public void refresh(Object entity, LockModeType lockModeType)
refresh
in interface EntityManager
public void refresh(Object entity, LockModeType lockModeType, Map<String,Object> properties)
refresh
in interface EntityManager
public boolean contains(Object entity)
contains
in interface EntityManager
public LockModeType getLockMode(Object entity)
getLockMode
in interface EntityManager
public void setProperty(String s, Object o)
setProperty
in interface EntityManager
public Map<String,Object> getProperties()
getProperties
in interface EntityManager
public void flush()
flush
in interface EntityManager
public abstract Session getSession()
getSession
in interface HibernateEntityManager
IllegalStateException
- if the entity manager is closedprotected abstract Session getRawSession()
public EntityTransaction getTransaction()
getTransaction
in interface EntityManager
public EntityManagerFactoryImpl getEntityManagerFactory()
getEntityManagerFactory
in interface EntityManager
public HibernateEntityManagerFactory getFactory()
getFactory
in interface HibernateEntityManagerImplementor
public javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
getCriteriaBuilder
in interface EntityManager
public javax.persistence.metamodel.Metamodel getMetamodel()
getMetamodel
in interface EntityManager
public void setFlushMode(FlushModeType flushModeType)
setFlushMode
in interface EntityManager
public void clear()
clear
in interface EntityManager
public void detach(Object entity)
detach
in interface EntityManager
public FlushModeType getFlushMode()
getFlushMode
in interface EntityManager
public void lock(Object entity, LockModeType lockMode)
lock
in interface EntityManager
public void lock(Object entity, LockModeType lockModeType, Map<String,Object> properties)
lock
in interface EntityManager
public LockOptions getLockRequest(LockModeType lockModeType, Map<String,Object> properties)
HibernateEntityManagerImplementor
LockModeType
& properties into LockOptions
getLockRequest
in interface HibernateEntityManagerImplementor
lockModeType
- is the requested lock typeproperties
- are the lock properties
public boolean isTransactionInProgress()
HibernateEntityManagerImplementor
isTransactionInProgress
in interface HibernateEntityManagerImplementor
protected void markAsRollback()
public void joinTransaction()
joinTransaction
in interface EntityManager
public <T> T unwrap(Class<T> clazz)
unwrap
in interface EntityManager
public Object getDelegate()
getDelegate
in interface EntityManager
public void handlePersistenceException(PersistenceException e)
handlePersistenceException
in interface HibernateEntityManagerImplementor
e
- The exception being handled.public void throwPersistenceException(PersistenceException e)
HibernateEntityManagerImplementor.handlePersistenceException(javax.persistence.PersistenceException)
and then throws the given exception.
throwPersistenceException
in interface HibernateEntityManagerImplementor
e
- The exception being handled and finally thrown.public RuntimeException convert(HibernateException e)
HibernateEntityManagerImplementor.handlePersistenceException(javax.persistence.PersistenceException)
are also made.
convert
in interface HibernateEntityManagerImplementor
e
- The Hibernate excepton.
public RuntimeException convert(RuntimeException e)
public RuntimeException convert(HibernateException e, LockOptions lockOptions)
HibernateEntityManagerImplementor.handlePersistenceException(javax.persistence.PersistenceException)
are also made.
convert
in interface HibernateEntityManagerImplementor
e
- The Hibernate excepton.lockOptions
- The lock options in effect at the time of exception (can be null)
public void throwPersistenceException(HibernateException e)
HibernateEntityManagerImplementor.convert(org.hibernate.HibernateException, org.hibernate.LockOptions)
and then throws the given exception.
throwPersistenceException
in interface HibernateEntityManagerImplementor
e
- The exception being handled and finally thrown.public PersistenceException wrapStaleStateException(StaleStateException e)
wrapStaleStateException
in interface HibernateEntityManagerImplementor
public PersistenceException wrapLockException(HibernateException e, LockOptions lockOptions)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |