org.springframework.orm.jpa
Interface EntityManagerProxy


public interface EntityManagerProxy

Subinterface of javax.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 javax.persistence.EntityManager#getDelegate() method to access native functionality of the underlying resource.

Since:
2.5
Author:
Juergen Hoeller

Method Summary
 EntityManager getTargetEntityManager()
          Return the underlying EntityManager that this proxy will delegate to.
 

Method Detail

getTargetEntityManager

EntityManager getTargetEntityManager()
                                     throws java.lang.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 of a transaction, an IllegalStateException will be thrown.

Returns:
the underlying raw EntityManager (never null)
Throws:
java.lang.IllegalStateException - if no underlying EntityManager is available