3 Replies Latest reply on Oct 13, 2005 5:43 AM by Gavin King

    trying to downstep to hibernate API

    Patrick Angeles Novice

      Hey all,

      I'm using the special SEAM build of jBoss (jboss-jdk5-seam-403RC2.zip) pretty much out of the box. (Don't have the expertise to get dirty with installing jBoss/EJB3 just yet.)

      My problem: I want to use hibernate API calls (esp. the Criteria API) from within my DAOs. Inside my DAOs, I have the EntityManager injected (I *think* this is working...). On certain methods within the DAO, I cast EntityManager to HibernateEntityManager.

      This gives me the following ClassCastException:

      16:08:46,468 INFO [STDOUT] java.lang.ClassCastException: org.jboss.ejb3.entity.InjectedEntityManager
      16:08:46,468 INFO [STDOUT] at com.inertiabev.odb.EntityDaoBean.getCurrentSession(Unknown Source)
      16:08:46,468 INFO [STDOUT] at com.inertiabev.odb.EntityDaoBean.listByCriteria(Unknown Source)

      What gives? I thought jBoss used the hibernate APIs underneath to implement EJB3 persistence...

      Is there any other way for me to use hibernate APIs from within jBoss/EJB3/SEAM? (I'm new to all three, so please be gentle.)