Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate fetching a list

 
Brian Mulholland
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I have a query that returns N entities, each with multiple layers of subdetail. Is there a way i can get Hibernate to build a join so it can populate the object hierarchy in each row from a single statement? Because today, according to the show_sql attribute being on, I can see that it is making a query for each detail element. That isn't going to scale nicely over some features.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the join fetch in the query.

Check here for more details: http://uaihebert.com/?p=1274
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic