[jboss-user] [JBoss Seam] - Re: Queries with optional arguments

2007-11-06 Thread damianharvey
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

[jboss-user] [JBoss Seam] - Re: Queries with optional arguments

2007-11-05 Thread matt.drees
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.

[jboss-user] [JBoss Seam] - Re: Queries with optional arguments

2007-11-05 Thread [EMAIL PROTECTED]
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/