Anyone has come across the problem where you need to define multiple or 
statement in a hibernate criteria. Consider the following code segment:

  | Criteria crit = session.createCriteria(Project.class);
  |             Criteria jobs = crit.createCriteria("jobTypes");
  | jobs.add(Restrictions.or(Restrictions.eq("id", 1),
  |                             Restrictions.or(Restrictions.eq("id", 2),
  |                                             
Restrictions.or(Restrictions.eq("id", 3), 
  |                                                             
Restrictions.or(Restrictions.eq("id", 4),Restrictions.eq("id", 5))
  |             ))));
  | 
Now, how would one create such a nested OR cirterion using for/while loop if 
one has any number of different ids {1,2,3,4,5,6.....}?

Thanks,
Rizwan

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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4239585
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to