Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: James Rivera   on Mar 22 In Java Category.

  
Question Answered By: Ludo Ricci   on Mar 22

Imagine that A has a collection of Bs. Here is the technique. Join all the objects in the criteria  and then start adding the where clause but here is your query in its general form :



Query query=getSession().createQuery("from A a left outer join a.B b where b.x< :something").

setParameter("something", 10 /*for example*/);

return query.list();



Here is what I always do. I google "hibernate reference + hql". The first result will take you to a hibernate  Heaven. You can find  more complex examples out there....

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Hibernate Criteria question Or get search suggestion and latest updates.


Tagged: