Top Description Inners Methods
org.hibernate.jpa.spi

public Interface HibernateEntityManagerImplementor

extends HibernateEntityManager, HibernateEntityManagerFactoryAware
Known Direct Subinterfaces
org.hibernate.engine.spi.SessionImplementor
Known Direct Implementers
org.hibernate.internal.SessionImpl
Annotations
@Deprecated
Imports
java.util.List, .Map, javax.persistence.LockModeType, .PersistenceException, javax.persistence.criteria.Selection, org.hibernate.HibernateException, .LockOptions, .StaleStateException, org.hibernate.ejb.HibernateEntityManager, org.hibernate.engine.spi.SessionImplementor, org.hibernate.query.Query, org.hibernate.query.criteria.internal.ValueHandlerFactory, org.hibernate.type.Type

Deprecated

(since 5.2) move these methods to SessionImplementor

Additional internal contracts for the Hibernate javax.persistence.EntityManager implementation.
Authors
Emmanuel Bernard, Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Method Summary

Modifier and TypeMethod and Description
public default LockOptions

Returns:

the LockOptions
buildLockOptions
(LockModeType
the requested LockModeType
lockModeType
,
Map<String, Object>
the lock properties
properties
)

Given a JPA javax.persistence.LockModeType and properties, build a Hibernate org.hibernate.LockOptions

public void
checkOpen(boolean
If the EM is closed, should the transaction (if one) be marked for rollback?
markForRollbackIfClosed
)

Used to ensure the EntityManager is open, throwing IllegalStateException if it is closed.

public <
The query type
T
>
Query<T>

Returns:

The typed query
createQuery
(String
The criteria query rendered as a JPA QL string
jpaqlString
,
Class<T>
The result type (the type expected in the result list)
resultClass
,
Selection<X>
The selection(s)
selection
,
HibernateEntityManagerImplementor.QueryOptions
The options to use to build the query.
queryOptions
)

Deprecated (since 5.2) this method form is used to construct a "compiled" representation of a JPA Criteria query.
Used during "compiling" a JPA criteria query.
public LockOptions

Returns:

the LockOptions
getLockRequest
(LockModeType
is the requested lock type
lockModeType
,
Map<String, Object>
are the lock properties
properties
)

Deprecated (since 5.2) use buildLockOptions(LockModeType, Map) instead
Convert from JPA 2 javax.persistence.LockModeType & properties into org.hibernate.LockOptions
public SessionImplementor
getSession()

Redeclares org.hibernate.jpa.HibernateEntityManager.getSession.

Deprecated as a consequence of SessionImplementor being deprecated.
Retrieve a reference to the Hibernate org.hibernate.Session used by this javax.persistence.EntityManager.
public boolean

Returns:

True if a transaction is considered currently in progress; false otherwise.
isTransactionInProgress
()

Provides access to whether a transaction is currently in progress.

public void
markForRollbackOnly()

Used to mark a transaction for rollback only (when that is the JPA spec defined behavior).

Inherited from org.hibernate.jpa.spi.HibernateEntityManagerFactoryAware:
getFactory

Method Detail

buildLockOptionsback to summary
public default LockOptions buildLockOptions(LockModeType lockModeType, Map<String, Object> properties)

Given a JPA javax.persistence.LockModeType and properties, build a Hibernate org.hibernate.LockOptions

Parameters
lockModeType:LockModeType

the requested LockModeType

properties:Map<String, Object>

the lock properties

Returns:LockOptions

the LockOptions

checkOpenback to summary
public void checkOpen(boolean markForRollbackIfClosed) throws IllegalStateException

Used to ensure the EntityManager is open, throwing IllegalStateException if it is closed. Depending on the value of 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.

Parameters
markForRollbackIfClosed:boolean

If the EM is closed, should the transaction (if one) be marked for rollback?

Exceptions
IllegalStateException:
Thrown if the EM is closed
createQueryback to summary
public <T> Query<T> createQuery(String jpaqlString, Class<T> resultClass, Selection<X> selection, HibernateEntityManagerImplementor.QueryOptions queryOptions)

Deprecated

(since 5.2) this method form is used to construct a "compiled" representation of a JPA Criteria query. However it assumes the old yucky implementation of "compilation" that converted the Criteria into a HQL/JPQL string. In 6.0 that is re-written from scratch to compile to SQM, and so this method would not be needed in 6.0

Used during "compiling" a JPA criteria query.

Parameters
<T>
The query type
jpaqlString:String

The criteria query rendered as a JPA QL string

resultClass:Class<T>

The result type (the type expected in the result list)

selection:Selection<X>

The selection(s)

queryOptions:HibernateEntityManagerImplementor.QueryOptions

The options to use to build the query.

Returns:Query<T>

The typed query

Annotations
@Deprecated
getLockRequestback to summary
public LockOptions getLockRequest(LockModeType lockModeType, Map<String, Object> properties)

Deprecated

(since 5.2) use buildLockOptions(LockModeType, Map) instead

Convert from JPA 2 javax.persistence.LockModeType & properties into org.hibernate.LockOptions

Parameters
lockModeType:LockModeType

is the requested lock type

properties:Map<String, Object>

are the lock properties

Returns:LockOptions

the LockOptions

Annotations
@Deprecated
getSessionback to summary
public SessionImplementor getSession()

Redeclares org.hibernate.jpa.HibernateEntityManager.getSession.

Doc from org.hibernate.jpa.HibernateEntityManager.getSession.

Deprecated

as a consequence of SessionImplementor being deprecated. See corresponding docs for further information.

Retrieve a reference to the Hibernate org.hibernate.Session used by this javax.persistence.EntityManager.

Returns:SessionImplementor

The session

Annotations
@Override
isTransactionInProgressback to summary
public boolean isTransactionInProgress()

Provides access to whether a transaction is currently in progress.

Returns:boolean

True if a transaction is considered currently in progress; false otherwise.

markForRollbackOnlyback to summary
public void markForRollbackOnly()

Used to mark a transaction for rollback only (when that is the JPA spec defined behavior).

org.hibernate.jpa.spi back to summary

public Interface HibernateEntityManagerImplementor.QueryOptions


Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Method Summary

Modifier and TypeMethod and Description
public Map<String, Class<T>>

Returns:

The
getNamedParameterExplicitTypes
()

Get the explicit parameter types.

public HibernateEntityManagerImplementor.QueryOptions.ResultMetadataValidator
public List<ValueHandlerFactory.ValueHandler<T>>

Returns:

Value conversions to be applied to the JPA QL results
getValueHandlers
()

Get the conversions for the individual tuples in the query results.

Method Detail

getNamedParameterExplicitTypesback to summary
public Map<String, Class<T>> getNamedParameterExplicitTypes()

Get the explicit parameter types. Generally speaking these would apply to implicit named parameters.

Returns:Map<String, Class<T>>

The

getResultMetadataValidatorback to summary
public HibernateEntityManagerImplementor.QueryOptions.ResultMetadataValidator getResultMetadataValidator()
getValueHandlersback to summary
public List<ValueHandlerFactory.ValueHandler<T>> getValueHandlers()

Get the conversions for the individual tuples in the query results.

Returns:List<ValueHandlerFactory.ValueHandler<T>>

Value conversions to be applied to the JPA QL results

org.hibernate.jpa.spi back to summary

public Interface HibernateEntityManagerImplementor.QueryOptions.ResultMetadataValidator


Method Summary

Modifier and TypeMethod and Description
public void
validate(Type[] returnTypes)

Method Detail

validateback to summary
public void validate(Type[] returnTypes)