Top Description Methods
org.springframework.orm.jpa

public Interface EntityManagerProxy

extends EntityManager
Imports
jakarta.persistence.EntityManager

Subinterface of jakarta.persistence.EntityManager to be implemented by EntityManager proxies. Allows access to the underlying target EntityManager.

This interface is mainly intended for framework usage. Application code should prefer the use of the jakarta.persistence.EntityManager#getDelegate() method to access native functionality of the underlying resource.

Author
Juergen Hoeller
Since
2.5

Method Summary

Modifier and TypeMethod and Description
public EntityManager

Returns:

the underlying raw EntityManager (never null)
getTargetEntityManager
()

Return the underlying EntityManager that this proxy will delegate to.

Inherited from jakarta.persistence.EntityManager:
clearclosecontainscreateEntityGraphcreateEntityGraphcreateNamedQuerycreateNamedQuerycreateNamedStoredProcedureQuerycreateNativeQuerycreateNativeQuerycreateNativeQuerycreateQuerycreateQuerycreateQuerycreateQuerycreateQuerycreateStoredProcedureQuerycreateStoredProcedureQuerycreateStoredProcedureQuerydetachfindfindfindfindflushgetCriteriaBuildergetDelegategetEntityGraphgetEntityGraphsgetEntityManagerFactorygetFlushModegetLockModegetMetamodelgetPropertiesgetReferencegetTransactionisJoinedToTransactionisOpenjoinTransactionlocklockmergepersistrefreshrefreshrefreshrefreshremovesetFlushModesetPropertyunwrap

Method Detail

getTargetEntityManagerback to summary
public EntityManager getTargetEntityManager() throws IllegalStateException

Return the underlying EntityManager that this proxy will delegate to.

In case of an extended EntityManager, this will be the associated raw EntityManager.

In case of a shared ("transactional") EntityManager, this will be the raw EntityManager that is currently associated with the transaction. Outside a transaction, an IllegalStateException will be thrown.

Returns:EntityManager

the underlying raw EntityManager (never null)

Exceptions
IllegalStateException:
if no underlying EntityManager is available