-->
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: Hibernate bug with unidrectional composite outer join?
PostPosted: Mon Jul 17, 2006 12:01 pm 
Beginner
Beginner

Joined: Mon Dec 26, 2005 3:29 pm
Posts: 23
Hibernate version: 3.1

There seems to be a bug with Hibernate's approach to dealing with a unidirectional outer join when using a composite pattern.

I have a Composite class, let's call it User, that contains other Users. The table tracks User records across time. So when loading a User row, we wish to also load its subsequent rows. So I would have liked to use fetch="join", like so:


Code:
<union-subclass name="ManagerRow" table="cut_managers" extends="UserRow">
   ...
   <set name="childrenRows" fetch="join" cascade="all">
      <key column="id_bk_prev" />
      <one-to-many class="UserRow"/>
   </set>


However, when doing this, Hibernate give me a lazy initialization exception if the outer join finds no children. Setting lazy="false" does not help.

When I take out the fetch="join" and Hibernate issues separate SQLs for the parent and children, then it all works fine.

Apparently Hibernate sees the null coumns from the outer join as an attempt to access lazy objects loaded in a different session.

Any others find this?


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.