-->
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: stackoverflow with fetch="join"
PostPosted: Tue May 31, 2005 4:42 am 
Regular
Regular

Joined: Wed Sep 22, 2004 8:27 am
Posts: 89
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.01

Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping default-lazy="false">

<class name="com.coginfo.kf.bean.Dominio" table="KFT_DOMINIO" select-before-update="true">
<meta attribute="class-description">Dominio</meta>
<id name="codint" type="long" unsaved-value="0">
<generator class="sequence">
<param name="sequence">KF_SEQ_DOMINIO</param>
</generator>
</id>

<property name="cafdsc" type="string">
<column name="cafdsc" length="1000" sql-type="string" not-null="true"/>
</property>

<property name="numdmn" type="string">
<column name="numdmn" length="5" sql-type="string" not-null="true"/>
</property>

<property name="caflbl" type="string">
<column name="caflbl" length="500" sql-type="string" not-null="true"/>
</property>

<property name="caftipdto" type="string">
<column name="caftipdto" length="20" sql-type="string" not-null="true"/>
</property>

<property name="caffordto" type="string">
<column name="caffordto" length="20" sql-type="string" not-null="false"/>
</property>

<set name="modalita" lazy="true" fetch="join">
<key column="codintdmn"/>
<one-to-many class="com.coginfo.kf.bean.Modalita"/>
</set>

</class>

</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():

session.createCriteria(Domionio.class);


Full stack trace of any exception that occurs:
No stack, by debug i found:
java.lang.StackOverflowError


Name and version of the database you are using:
oracle 9

The generated SQL (show_sql=true):
select this_.codint as codint1_, this_.cafdsc as cafdsc10_1_, this_.numdmn as numdmn10_1_, this_.caflbl as caflbl10_1_, this_.caftipdto as caftipdto10_1_, this_.caffordto as caffordto10_1_, modalita2_.codintdmn as codintdmn__, modalita2_.codint as codint__, modalita2_.codintdmn as codintdmn0_, modalita2_.codint as codint0_, modalita2_.codint as codint11_0_, modalita2_.codintdmn as codintdmn11_0_, modalita2_.cafdsc as cafdsc11_0_, modalita2_.codtip as codtip11_0_, modalita2_.codintvalmod as codintva5_11_0_ from KFT_DOMINIO this_ left outer join KFT_MODALITA modalita2_ on this_.codint=modalita2_.codintdmn where 1=1 order by this_.codint asc


The problem is this query works but after this hibernate generete a lot of this statements:
Hibernate: select dominio0_.codint as codint1_, dominio0_.cafdsc as cafdsc10_1_, dominio0_.numdmn as numdmn10_1_, dominio0_.caflbl as caflbl10_1_, dominio0_.caftipdto as caftipdto10_1_, dominio0_.caffordto as caffordto10_1_, modalita1_.codintdmn as codintdmn__, modalita1_.codint as codint__, modalita1_.codintdmn as codintdmn0_, modalita1_.codint as codint0_, modalita1_.codint as codint11_0_, modalita1_.codintdmn as codintdmn11_0_, modalita1_.cafdsc as cafdsc11_0_, modalita1_.codtip as codtip11_0_, modalita1_.codintvalmod as codintva5_11_0_ from KFT_DOMINIO dominio0_ left outer join KFT_MODALITA modalita1_ on dominio0_.codint=modalita1_.codintdmn where dominio0_.codint=?

i think one for all rows of table Dominio with join table Modalita


plz, help me


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 31, 2005 4:46 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
3.0.5


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 31, 2005 4:55 am 
Regular
Regular

Joined: Wed Sep 22, 2004 8:27 am
Posts: 89
i m sorry you would tell me with rel 3.05 will i solve my problem?
sure?


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 31, 2005 5:00 am 
Regular
Regular

Joined: Wed Sep 22, 2004 8:27 am
Posts: 89
ok just try 3.05, but i've the same problem... any other solutions?


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.