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