1 Reply Latest reply on Oct 23, 2009 4:10 AM by Nikolay Elenkov

    Seam + Hibernate Search + Hibernate Criteria API - Possible ?

    Ilya Dyoshin Newbie

      Good day!

      I'm developing a seam application. It uses the Hibernate Search, and now It also need to use Criteria API.

      I'm trying to create Criteria with following code :

      ((EntityManagerImpl) this.getEntityManager().getDelegate()).getSession().createCriteria(MineEntity.class);

      and here it dies with following:

      java.lang.ClassCastException: org.jboss.seam.persistence.FullTextEntityManagerProxy cannot be cast to org.hibernate.ejb.EntityManagerImpl 

      looking in deep I found that actually EntityManager injected from Seam isn't hibernateEntityManager - there is some Seam's class that implements EntityManager interface.

      So the main question, how to configure SEAM HIBERNATE  and HIBERNATE SEARCH to make them workable with HIBERNATE CRITERIA API ?

      Ah... once more, now mine application is configured to run as the WAR (inside the maven and jetty-plugin)... but I gues that shouldn't be a problem.