spring-framework / org.springframework.orm.jpa / EntityManagerProxy / getTargetEntityManager

getTargetEntityManager

abstract fun getTargetEntityManager(): EntityManager

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 of a transaction, an IllegalStateException will be thrown.

Exceptions

IllegalStateException - if no underlying EntityManager is available

Return
the underlying raw EntityManager (never null)