public abstract class AbstractEntityManagerImpl extends Object implements HibernateEntityManagerImplementor, Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractEntityManagerImpl.TupleBuilderTransformer |
HibernateEntityManagerImplementor.Options| Modifier and Type | Field and Description |
|---|---|
protected PersistenceContextType |
persistenceContextType |
protected TransactionImpl |
tx |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractEntityManagerImpl(EntityManagerFactoryImpl entityManagerFactory,
PersistenceContextType type,
PersistenceUnitTransactionType transactionType,
Map properties) |
| Modifier and Type | Method and Description |
|---|---|
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) |
<T> TypedQuery<T> |
createNamedQuery(String name,
Class<T> resultClass) |
Query |
createNativeQuery(String sqlString) |
Query |
createNativeQuery(String sqlString,
Class resultClass) |
Query |
createNativeQuery(String sqlString,
String resultSetMapping) |
<T> TypedQuery<T> |
createQuery(CriteriaQuery<T> criteriaQuery) |
Query |
createQuery(String jpaqlString) |
<T> TypedQuery<T> |
createQuery(String jpaqlString,
Class<T> resultClass) |
<T> TypedQuery<T> |
createQuery(String jpaqlString,
Class<T> resultClass,
Selection selection,
HibernateEntityManagerImplementor.Options options)
Used during "compiling" a JPA criteria query.
|
void |
detach(Object entity) |
CacheMode |
determineAppropriateLocalCacheMode(Map<String,Object> localProperties) |
<A> A |
find(Class<A> entityClass,
Object primaryKey) |
<A> A |
find(Class<A> entityClass,
Object primaryKey,
LockModeType lockModeType) |
<A> A |
find(Class<A> entityClass,
Object primaryKey,
LockModeType lockModeType,
Map<String,Object> properties) |
<T> T |
find(Class<T> entityClass,
Object primaryKey,
Map<String,Object> properties) |
void |
flush() |
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 |
Metamodel |
getMetamodel() |
Map<String,Object> |
getProperties() |
protected abstract Session |
getRawSession()
Return a Session (even if the entity manager is closed).
|
<T> T |
getReference(Class<T> entityClass,
Object primaryKey) |
abstract Session |
getSession()
return a Session
|
EntityTransaction |
getTransaction() |
PersistenceUnitTransactionType |
getTransactionType() |
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() |
<A> A |
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. |
<T> T |
unwrap(Class<T> clazz) |
PersistenceException |
wrapLockException(HibernateException e,
LockOptions lockOptions) |
PersistenceException |
wrapStaleStateException(StaleStateException e) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, isOpenprotected transient TransactionImpl tx
protected PersistenceContextType persistenceContextType
protected AbstractEntityManagerImpl(EntityManagerFactoryImpl entityManagerFactory, PersistenceContextType type, PersistenceUnitTransactionType transactionType, Map properties)
public PersistenceUnitTransactionType getTransactionType()
protected void postInit()
public Query createQuery(String jpaqlString)
createQuery in interface EntityManagerpublic <T> TypedQuery<T> createQuery(String jpaqlString, Class<T> resultClass)
createQuery in interface EntityManagerpublic <T> TypedQuery<T> createQuery(String jpaqlString, Class<T> resultClass, Selection selection, HibernateEntityManagerImplementor.Options options)
HibernateEntityManagerImplementorcreateQuery in interface HibernateEntityManagerImplementorT - 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(CriteriaQuery<T> criteriaQuery)
createQuery in interface EntityManagerpublic Query createNamedQuery(String name)
createNamedQuery in interface EntityManagerpublic <T> TypedQuery<T> createNamedQuery(String name, Class<T> resultClass)
createNamedQuery in interface EntityManagerpublic Query createNativeQuery(String sqlString)
createNativeQuery in interface EntityManagerpublic Query createNativeQuery(String sqlString, Class resultClass)
createNativeQuery in interface EntityManagerpublic Query createNativeQuery(String sqlString, String resultSetMapping)
createNativeQuery in interface EntityManagerpublic <T> T getReference(Class<T> entityClass, Object primaryKey)
getReference in interface EntityManagerpublic <A> A find(Class<A> entityClass, Object primaryKey)
find in interface EntityManagerpublic <T> T find(Class<T> entityClass, Object primaryKey, Map<String,Object> properties)
find in interface EntityManagerpublic <A> A find(Class<A> entityClass, Object primaryKey, LockModeType lockModeType)
find in interface EntityManagerpublic <A> A find(Class<A> entityClass, Object primaryKey, LockModeType lockModeType, Map<String,Object> properties)
find in interface EntityManagerpublic CacheMode determineAppropriateLocalCacheMode(Map<String,Object> localProperties)
public void persist(Object entity)
persist in interface EntityManagerpublic <A> A merge(A entity)
merge in interface EntityManagerpublic void remove(Object entity)
remove in interface EntityManagerpublic void refresh(Object entity)
refresh in interface EntityManagerpublic void refresh(Object entity, Map<String,Object> properties)
refresh in interface EntityManagerpublic void refresh(Object entity, LockModeType lockModeType)
refresh in interface EntityManagerpublic void refresh(Object entity, LockModeType lockModeType, Map<String,Object> properties)
refresh in interface EntityManagerpublic boolean contains(Object entity)
contains in interface EntityManagerpublic LockModeType getLockMode(Object entity)
getLockMode in interface EntityManagerpublic void setProperty(String s, Object o)
setProperty in interface EntityManagerpublic Map<String,Object> getProperties()
getProperties in interface EntityManagerpublic void flush()
flush in interface EntityManagerpublic abstract Session getSession()
getSession in interface HibernateEntityManagerIllegalStateException - if the entity manager is closedprotected abstract Session getRawSession()
public EntityTransaction getTransaction()
getTransaction in interface EntityManagerpublic EntityManagerFactoryImpl getEntityManagerFactory()
getEntityManagerFactory in interface EntityManagerpublic HibernateEntityManagerFactory getFactory()
getFactory in interface HibernateEntityManagerImplementorpublic CriteriaBuilder getCriteriaBuilder()
getCriteriaBuilder in interface EntityManagerpublic Metamodel getMetamodel()
getMetamodel in interface EntityManagerpublic void setFlushMode(FlushModeType flushModeType)
setFlushMode in interface EntityManagerpublic void clear()
clear in interface EntityManagerpublic void detach(Object entity)
detach in interface EntityManagerpublic FlushModeType getFlushMode()
getFlushMode in interface EntityManagerpublic void lock(Object entity, LockModeType lockMode)
lock in interface EntityManagerpublic void lock(Object entity, LockModeType lockModeType, Map<String,Object> properties)
lock in interface EntityManagerpublic LockOptions getLockRequest(LockModeType lockModeType, Map<String,Object> properties)
HibernateEntityManagerImplementorLockModeType & properties into LockOptionsgetLockRequest in interface HibernateEntityManagerImplementorlockModeType - is the requested lock typeproperties - are the lock propertiespublic boolean isTransactionInProgress()
HibernateEntityManagerImplementorisTransactionInProgress in interface HibernateEntityManagerImplementorprotected void markAsRollback()
public void joinTransaction()
joinTransaction in interface EntityManagerpublic <T> T unwrap(Class<T> clazz)
unwrap in interface EntityManagerpublic Object getDelegate()
getDelegate in interface EntityManagerpublic void handlePersistenceException(PersistenceException e)
handlePersistenceException in interface HibernateEntityManagerImplementore - The exception being handled.public void throwPersistenceException(PersistenceException e)
HibernateEntityManagerImplementor.handlePersistenceException(javax.persistence.PersistenceException) and then throws the given exception.throwPersistenceException in interface HibernateEntityManagerImplementore - The exception being handled and finally thrown.public RuntimeException convert(HibernateException e)
HibernateEntityManagerImplementor.handlePersistenceException(javax.persistence.PersistenceException) are also made.convert in interface HibernateEntityManagerImplementore - 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 HibernateEntityManagerImplementore - 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 HibernateEntityManagerImplementore - The exception being handled and finally thrown.public PersistenceException wrapStaleStateException(StaleStateException e)
wrapStaleStateException in interface HibernateEntityManagerImplementorpublic PersistenceException wrapLockException(HibernateException e, LockOptions lockOptions)
Copyright © 2001-2013 Red Hat, Inc. All Rights Reserved.