I haven't looked into the delegate/criteria stuff but my lazy-man's way of
doing this is:
| List customers = entityManager.createQuery("select c from
Customer as c "+
| " where c.customerId >= :minCustomerId"+
| " and c.customerId <= :maxCustomerId")
| .setParameter("minCustom
You could look into using Krank's JPA Criteria. I hope to at some point.
http://www-128.ibm.com/developerworks/blogs/page/JEE?entry=criteria_qbe_dsl_for_jpa
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4101908#4101908
Reply to the post :
http://www.jboss.
Use
org.hibernate.Session session = (Session) entityManager.getDelegate();
to get the Hibernate Session out and use the Criteria API. Yes, this does make
your application non-portable to other JPA implementations, but that is the
price you pay.
View the original post :
http://www.jboss.com/