public interface HibernateEntityManagerImplementor extends HibernateEntityManager
EntityManager
implementation.Modifier and Type | Interface and Description |
---|---|
static interface |
HibernateEntityManagerImplementor.Options |
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.Options options)
Used during "compiling" a JPA criteria query.
|
HibernateEntityManagerFactory |
getFactory()
Get access to the Hibernate extended EMF contract.
|
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 |
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
HibernateEntityManagerFactory 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 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.Options options)
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.Copyright © 2001-2013 Red Hat, Inc. All Rights Reserved.