-->
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: Dynamic associations loading
PostPosted: Tue Jul 14, 2009 5:58 pm 
Newbie

Joined: Tue Jul 14, 2009 4:11 pm
Posts: 1
Hello, I am a beginner in whole hibernate concept, trying to implement optional loading of master-detail association. I realize that there is a lazy load option, but since my entities are loaded in to a List as part of a message to be sent, all nested lazy collections get populatedall all the time.
So far I could come up only with generating outer join and filter out details by setting a criteria FK_Field IS NULL:

if (!request.ReturnDetails)
criteria.CreateCriteria("Detail", NHibernate.SqlCommand.JoinType.LeftOuterJoin).Add(Expression.IsNull("FKMasterId"));

I hope it is not the best solution, which nHibernate could provide and would highly appreciate help with it.
Thanks.


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.