• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

restrict queries in association while fetching data....

 
Bhavin Sanghani
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I want to restrict few queries while fetching the data. I have kept lazy="false" in my code with fetch="subselect" and "join" as appropriate. Now, I want to fetch objects upto one level and at second level except one association i want to discard everything in query. e.g.

In following mapping strucutre, I want to load all QuestionsAnswer with Question & Answer objects only and not Feature which has association in Answer:




Any idea how can I do this?

Thanks,
Bhavin
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to map the association to feature as lazy and not eagerly fetch it in your HQL/Criteria.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic