-->
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.  [ 4 posts ] 
Author Message
 Post subject: Fetching one-to-one properties with a single select
PostPosted: Mon Dec 12, 2005 2:11 pm 
Newbie

Joined: Mon Dec 12, 2005 1:56 pm
Posts: 4
Location: Hamburg
Hello!

I have created a query like this:

"from VirtualAsset va " +
"inner join fetch va.currency " +
"inner join fetch va.extendedCashFlow " +
"inner join fetch va.extendedCashFlow.contract " +
"where va.extendedCashFlow.contract.portfolio = :portfolio " +
"order by va.extendedCashFlow.contract.objId"

The contract has some one-to-one associations. I tried some suggestions to avoid lazy loading of these associations. But no one was successful. Can anyone help?

Thanks
olli73


Top
 Profile  
 
 Post subject: ?
PostPosted: Mon Dec 12, 2005 6:37 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Please be more specific and provide mappings and explicitly specify things you have tried.

By the way, did you specify hibernate.max_fetch_depth?

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 13, 2005 5:57 am 
Newbie

Joined: Mon Dec 12, 2005 1:56 pm
Posts: 4
Location: Hamburg
Thanks for your reply!

Modifying the property hibernate.max_fetch_depth did not change the behavior.

Here are the one-to-one mappings in my contract:

Contract.hbm.xml
<one-to-one name="contractEssentials" cascade="all" class="db.vag.ContractEssentials"/>
<one-to-one name="externalAssessment" cascade="all" class="db.vag.ExternalAssessment"/>
<one-to-one name="charges" cascade="all" class="db.vag.Charges"/>
<one-to-one name="refinancing" cascade="all" class="db.vag.Refinancing"/>
<one-to-one name="interestAndAmortization" cascade="all" class="db.vag.InterestAndAmortization"/>
<one-to-one name="legalAspects" cascade="all" class="db.vag.LegalAspects"/>
<one-to-one name="externalData" cascade="all" class="db.vag.ExternalData"/>

On the other side of the associations I do this:

ContractEssentials.hbm.xml
<one-to-one name="contract" constrained="true" class="db.vag.Contract"/>



olli73


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 13, 2005 6:07 am 
Beginner
Beginner

Joined: Wed Dec 17, 2003 2:54 pm
Posts: 26
Location: Oslo, Norway
olli73 wrote:
<one-to-one name="contractEssentials" cascade="all" class="db.vag.ContractEssentials"/>


Please try the "fetch" attribute.

http://www.hibernate.org/hib_docs/v3/re ... e-fetching

Geir


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.