-->
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.  [ 2 posts ] 
Author Message
 Post subject: Clarification on behavior of LEFT OUTER JOIN FETCH please
PostPosted: Wed Aug 06, 2008 10:12 pm 
Beginner
Beginner

Joined: Fri May 30, 2008 3:57 pm
Posts: 26
version 1.2.1
.Net 3.5



Sometimes I get null objects returned when I'm doing a LEFT OUTER JOIN FETCH of an entity and it's children (or their children).

Code:
FROM parent p
LEFT OUTER JOIN FETCH p.children child
LEFT OUTER JOIN FETCH child.children


where the collections are either mapped as lists or sets. initial testing shows that NHibernate is smart enough to deduce that a null return means no children in the resultset, but I still sometimes get null objects.

Under what circumstances will the above hql return with null objects for the children? Not all of the child objects are null, but some of them are.

PS
I believe a skipped list index will also result in null being inserted for that specific index. but I was hoping for other scenario's.


thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 07, 2008 2:36 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
Quote:
I believe a skipped list index will also result in null being inserted for that specific index. but I was hoping for other scenario's.


Afaik this is the bevahior you get when you have leaks in your index values and use lists. It shouldn't happen with sets since you don't have an index column there.

_________________
--Wolfgang


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

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.