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

How to do inner join while working with set in Hibernate

 
Saathvik Reddy
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using hibernate 3.1

I have a one-to-many association. I am using a set to represent the same.
By default hibernate retrieves the associated instance using an outer join but i want it to be inner join. How can i achieve this?

if you need any further details i will post them.

Please help me solve this issue?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will have to do this manually. So using a theta-style join, where the two id are joined through the WHERE clause like "WHERE a.pkid = b.fkid"

Or you can do it through an SQLQuery.

Mark
 
Saathvik Reddy
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,

Thanks for the reply. Is this the only way i can solve the issue.
because if i use theta-style joins i need to manually map the result back to the java objects.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic