public interface HibernateEntityManagerImplementor extends HibernateEntityManager, HibernateEntityManagerFactoryAware
EntityManager
implementation.Modifier and Type | Interface and Description |
---|---|
static interface |
HibernateEntityManagerImplementor.QueryOptions |
Modifier and Type | Method and Description |
---|---|
void |
checkOpen(boolean markForRollbackIfClosed)
Used to ensure the EntityManager is open, throwing IllegalStateException if it is closed.
|
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.
|
<T> QueryImpl<T> |
createQuery(String jpaqlString,
Class<T> resultClass,
Selection selection,
HibernateEntityManagerImplementor.QueryOptions queryOptions)
Used during "compiling" a JPA criteria query.
|
LockOptions |
getLockRequest(LockModeType lockModeType,
Map<String,Object> properties)
Convert from JPA 2
LockModeType & properties into LockOptions |
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 |
markForRollbackOnly()
Used to mark a transaction for rollback only (when that is the JPA spec defined behavior).
|
void |
throwPersistenceException(HibernateException e)
Delegates to
convert(org.hibernate.HibernateException, org.hibernate.LockOptions) and then throws the given exception. |
void |
throwPersistenceException(PersistenceException e)
Delegates to
handlePersistenceException(javax.persistence.PersistenceException) and then throws the given exception. |
PersistenceException |
wrapStaleStateException(StaleStateException e) |
getSession
clear, close, contains, createEntityGraph, createEntityGraph, createNamedQuery, createNamedQuery, createNamedStoredProcedureQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, createQuery, createQuery, createQuery, createQuery, createStoredProcedureQuery, createStoredProcedureQuery, createStoredProcedureQuery, detach, find, find, find, find, flush, getCriteriaBuilder, getDelegate, getEntityGraph, getEntityGraphs, getEntityManagerFactory, getFlushMode, getLockMode, getMetamodel, getProperties, getReference, getTransaction, isJoinedToTransaction, isOpen, joinTransaction, lock, lock, merge, persist, refresh, refresh, refresh, refresh, remove, setFlushMode, setProperty, unwrap
getFactory
void checkOpen(boolean markForRollbackIfClosed) throws IllegalStateException
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.markForRollbackIfClosed
- If the EM is closed, should the transaction (if one) be marked for rollback?IllegalStateException
- Thrown if the EM is closedboolean isTransactionInProgress()
void markForRollbackOnly()
void handlePersistenceException(PersistenceException e)
e
- The exception being handled.void throwPersistenceException(PersistenceException e)
handlePersistenceException(javax.persistence.PersistenceException)
and then throws the given exception.e
- The exception being handled and finally thrown.RuntimeException convert(HibernateException e, LockOptions lockOptions)
handlePersistenceException(javax.persistence.PersistenceException)
are also made.e
- The Hibernate excepton.lockOptions
- The lock options in effect at the time of exception (can be null)RuntimeException convert(HibernateException e)
handlePersistenceException(javax.persistence.PersistenceException)
are also made.e
- The Hibernate excepton.void throwPersistenceException(HibernateException e)
convert(org.hibernate.HibernateException, org.hibernate.LockOptions)
and then throws the given exception.e
- The exception being handled and finally thrown.PersistenceException wrapStaleStateException(StaleStateException e)
LockOptions getLockRequest(LockModeType lockModeType, Map<String,Object> properties)
LockModeType
& properties into LockOptions
lockModeType
- is the requested lock typeproperties
- are the lock properties<T> QueryImpl<T> createQuery(String jpaqlString, Class<T> resultClass, Selection selection, HibernateEntityManagerImplementor.QueryOptions queryOptions)
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)queryOptions
- The options to use to build the query.Copyright © 2001-2017 Red Hat, Inc. All Rights Reserved.