-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Criteria with early fetch on related entity
PostPosted: Wed Oct 16, 2013 4:45 pm 
Newbie

Joined: Wed Oct 16, 2013 4:33 pm
Posts: 1
Hi,

I have 2 tables Authors and Books. In my hibernate mapping file of Authors, I have a property called "books" which is by default lazy. Now I want to create a criteria such that it returns me list of authors with early fetch on books and some restriction on the books. I mean, return me a list of authors with their list of books(I want this to be early fetched) where bookId = "someId" (The bookId column is on the Books table)

Also, I know that I can say early fetch in the "books" property in the Authors hbm file. But I dont want to this common for all of my calls. I want to specify early fetch in my criteria not in my hbm file.

Could anyone tell me how to do this?


Thank you


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.