接口 EntityManagerProxy
- 所有超级接口:
EntityManager
public interface EntityManagerProxy extends EntityManager
Subinterface ofEntityManager
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
EntityManager.getDelegate()
method to access native functionality of the underlying resource.- 从以下版本开始:
- 2.5
- 作者:
- Juergen Hoeller
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 EntityManager
getTargetEntityManager()
Return the underlying EntityManager that this proxy will delegate to.从接口继承的方法 javax.persistence.EntityManager
clear, close, contains, createNamedQuery, createNamedQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, createQuery, createQuery, detach, find, find, find, find, flush, getCriteriaBuilder, getDelegate, getEntityManagerFactory, getFlushMode, getLockMode, getMetamodel, getProperties, getReference, getTransaction, isOpen, joinTransaction, lock, lock, merge, persist, refresh, refresh, refresh, refresh, remove, setFlushMode, setProperty, unwrap
方法详细资料
getTargetEntityManager
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 of a transaction, an IllegalStateException will be thrown.
- 返回:
- the underlying raw EntityManager (never
null
) - 抛出:
IllegalStateException
- if no underlying EntityManager is available