-->
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.  [ 8 posts ] 
Author Message
 Post subject: Can one-to-many be selected one time?
PostPosted: Thu Jan 15, 2004 4:18 am 
Regular
Regular

Joined: Wed Dec 03, 2003 9:41 pm
Posts: 87
My xml configuration is like this:
<set name="bidPackage" lazy="false">
<key column="BID_ID"/>
<one-to-many class="com.bsteel.baointl.interbid.model.BidPackageModel"/>
</set>

h2 will select main table at first then select another table (BidPackageModel)by every result record in main table. It will generate many sql. Can I config something to let h2 select master and slave table together then auto split records into correct java class?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 15, 2004 9:50 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
use outer-join=true and enable outer join fetching in the hibernate config. Or use JOIN FETCH in HQL


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2004 2:35 am 
Regular
Regular

Joined: Wed Dec 03, 2003 9:41 pm
Posts: 87
Can attrubite out-join exist in element set?
I wrote xml as the following:
<set name="bidPackage" lazy="false" outer-join="true">
<key column="BID_ID"/>
<one-to-many class="com.bsteel.baointl.interbid.model.BidPackageModel"/>
</set>
But h2 throws Exception:
Error parsing XML: XML InputStream(11) Attribute "outer-join" must be declared for element type "set".

I used h2.1 rc1


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2004 6:47 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Yes, and from a long time ago. Your DTD loading sucks.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2004 11:33 pm 
Regular
Regular

Joined: Wed Dec 03, 2003 9:41 pm
Posts: 87
emmanuel wrote:
Yes, and from a long time ago. Your DTD loading sucks.

Do you mean my h2 loading a wrong DTD? I don't think I changed anything about DTD. Where is default DTD h2 loaded and can you give me any suggestion to fix this problem?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 17, 2004 1:49 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Upgrate to latest hibernate, use xerces which enable EntityResolver.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 11, 2004 5:12 am 
Newbie

Joined: Wed May 05, 2004 5:48 pm
Posts: 3
hi,

use hibernate 2.0.
have a mapping as described in the other mails in the topic.

i know i can update hibernate. the question is if i stay with the now hibernate, how can i deal with the problem?

globally i have set hibernate.use_outer_join to true. but it seems not useful. hibernate generates many SQL statements to find fathers and children.

can anyone help? many thanx!


--bs


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 18, 2004 2:33 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Check lazy="true" and proxy values of the mapping

_________________
Emmanuel


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