[jboss-user] [JBoss Seam] - Using the JPA delegate

eirirlar do-not-reply at jboss.com
Tue Feb 27 17:06:34 EST 2007


Hi, I wonder if I'm the only one who's encountered this when trying to use the JPA delegate when Hibernate is the underlying persitence provider.

Look at chapter 8.4 in the doc. It says:


  | @In EntityManager entityManager;
  | 
  | @Create
  | public void init() {
  |     ( (Session) entityManager.getDelegate() ).enableFilter("currentVersions");
  | }

>From my experience, entityManager.getDelegate() returns a org.hibernate.ejb.EntityManagerImpl, not a org.hibernate.Session. So the code in the example should be replaced by something like this:


  | @In EntityManager entityManager;
  | 
  | @Create
  | public void init() {
  |     ( (Session) ((HibernateEntityManager)em.getDelegate()).getSession()).enableFilter("currentVersions");
  | }

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023308#4023308

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023308



More information about the jboss-user mailing list