Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

THe Hibernate "In" clause

 
Preet Prasannan.
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have a requirement which needs to put in the in clause in hibernate. The problem is I am unable to do that.As the data on which I have to apply the in clause is also a subquery and not a list of static elements.

Eg:" from Abc abc where abc.id in (....sub qurery....) ----> Is this possible..I tried it but I am getting some syntatctical errors.

My query looks like

String queryString="from Xyz xyz,Abce abc where xyz.id=abc.id and abc.zzz.id in ( from ZZZ d," +
"where d.id=?)";
Please help.
 
Preet Prasannan.
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Got the answer.
I had a misplaced comma.
Thanks a lot.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic