hibernate-entitymanager

How can i get the session object if i have the entitymanager

孤街浪徒 提交于 2019-11-26 17:14:27
I have private EntityManager em; public List getAll(DetachedCriteria detachedCriteria) { return detachedCriteria.getExecutableCriteria( ??? ).list(); } How can i retrieve the session if am using entitymanager or how can i get the result from my detachedcriteria ? To be totally exhaustive, things are different if you're using a JPA 1.0 or a JPA 2.0 implementation. JPA 1.0 With JPA 1.0, you'd have to use EntityManager#getDelegate() . But keep in mind that the result of this method is implementation specific i.e. non portable from application server using Hibernate to the other. For example with