-->
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: NH-1211 is ancient and a real show-stopper too
PostPosted: Sat Jul 18, 2009 4:14 am 
Beginner
Beginner

Joined: Wed Aug 10, 2005 6:21 pm
Posts: 24
Location: Antwerp, Belgium
http://nhjira.koah.net/browse/NH-1211

it keeps getting pushed forward (Fix-version keeps getting bumped up)
but nobody is doing anything about. We dove into the code but we're
unable to find a way of fixing it. NHibernate is much more complicated
on the inside than we thought :-(

Is everybody working around this by manually tickling their collections
just in case they're empty ?


Top
 Profile  
 
 Post subject: Re: NH-1211 is ancient and a real show-stopper too
PostPosted: Thu Jul 23, 2009 6:32 am 
Beginner
Beginner

Joined: Wed Aug 10, 2005 6:21 pm
Posts: 24
Location: Antwerp, Belgium
OK, following up for future reference and posteriority :-)

using LEFT JOIN FETCH instead of just JOIN FETCH should make your problem with empty child collections go away.

so instead of doing

FROM Customer c JOIN FETCH c.Orders ord

and suffering exceptions when the customer has no Orders (yet)
you can just do

FROM Customer c LEFT JOIN FETCH c.Orders ord

and get a perfectly initialized empty Orders collection.

Makes sense too but we were under the impression that
JOIN FETCH was just shorthand for LEFT JOIN FETCH.
Turns out not to be true. :-S

Anyway, hope this helps anyone.


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.