-->
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.  [ 5 posts ] 
Author Message
 Post subject: map with index-many-to-many doesn't use outer-join
PostPosted: Thu May 26, 2005 1:12 pm 
Regular
Regular

Joined: Tue Nov 16, 2004 6:36 pm
Posts: 62
Location: Zürich
Hello,

using hibernate 2.1.8, with a mapping like this:
Code:
<class name='AssetGroup' ...>
<id...></id>
<map name='assetWeights' table="SE_ASSET_GROUP_WEIGHT" outer-join="true" lazy='false' access='property' cascade='all'>
         <key column='asset_group_id'/>
         <index-many-to-many class="com.csg.pmnet.as.model.Asset" column="asset_id"/>
         <composite-element class="AssetWeight">
            <property name='weight' column='initial_weight' access='field'/>
            <property name='covered' column='covered' access='field' type='yes_no'/>
            <property name='reason' column='reason' access='field'/>
            <property name='price' column='initial_price' access='field'/>
            <property name='priceCurrency' column='price_ccy' access='field'/>            
         </composite-element>
      </map>
</class>


When I load an AssetGroup, the map from Asset -> AssetWeight is not loaded eagerly but with many separate queries. This leads to bad performance of course.

Is it not possible to use eager fetching (not via HQL but directly using session.load() ) for index-many-to-many maps?

TIA,

Peter


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 8:44 pm 
Regular
Regular

Joined: Tue May 24, 2005 10:19 am
Posts: 65
put <property name="hibernate.use_outer_join">true</property> in n your hibernate configuration file.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 27, 2005 3:44 am 
Regular
Regular

Joined: Tue Nov 16, 2004 6:36 pm
Posts: 62
Location: Zürich
zesj wrote:
put <property name="hibernate.use_outer_join">true</property> in n your hibernate configuration file.


Hello,

We have that. Usually outer joins work well, except for this case.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 27, 2005 8:50 am 
Regular
Regular

Joined: Tue May 24, 2005 10:19 am
Posts: 65
many-to-many use intermediate table.
check value of hibernate.max_fetch_depth.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 27, 2005 9:00 am 
Regular
Regular

Joined: Tue May 24, 2005 10:19 am
Posts: 65
in the docs:hibernate.max_fetch_depth.....single-ended associations (one-to-one, many-to-one). note for many-to-many.
but,you can try.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.