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: fetchMode.eager pb if 2joins on 2classes stored in 1 table
PostPosted: Mon Jan 11, 2010 4:06 am 
Newbie

Joined: Mon Jan 11, 2010 3:49 am
Posts: 1
At the present time, we are using Hibernate 2.1.
All our mapping uses the “lazy=true” mode.
In the Java Code, to avoid multiple “select” to get information on a class, we use the “fetchMode.eager” in the criteria query or the “left join fetch” in an HQL query.
It works fine except in one case :
Code:
Select from Vehicule v left join fetch v.start s left join fetch v.arrival a

when both class “start” and “arrival” are stored in the same database table.
Code:
<class name="Vehicule" table="VEHICULE" lazy="true">
<many-to-one name="start" column="start" class="HbSite" cascade="none" not-null="true"/>
<many-to-one name="arrival" column="arrival" class="HbSite" cascade="none" not-null="true"/>


In that case, the generated SQL does not have 2 joins but only one. So, in the java code, hibernate need to execute many SQL query If we need a property of the object “start”.
Does hibernate 3 fixes this problem ?
Thanks.

Message was edited by:
Vincent Delhommois


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.