-->
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: Join fetch problem
PostPosted: Mon Nov 03, 2008 9:27 am 
Newbie

Joined: Wed Mar 03, 2004 10:19 am
Posts: 11
Location: Netherlands
I have a strange problem with join fetching. I have a parent class Constraint with a child class ConstraintTrigger. It is mapped as follows:

Code:
<set name="triggers" table="CST_COLX" fetch="join" access="field">
   <key>
      <column name="SYS_NM"/>
      <column name="CST_NM"/>
   </key>
   <one-to-many class="ConstraintTrigger"/>
</set>


Constraint has a composite primary key (SYS_NM + CST_NM), ConstraintTrigger has a generated identifier.

The problem is that when I query Constraint, Hibernate uses in its SQL a join between Constraint and ConstraintColumn, quite what you would expect. However, the value for the 'triggers' member is an unintialized PersistentSet, meaning that when you access the collection it performs a separate query to populate the collection, as if no 'fetch=join' was specified.

Anyone any thoughts?


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.