Hi,
I have a strange problem.
The problem is that when a query is executed, I find that the same table is linked twice. I am not sure why this is happening.
I am using hibernate 3.0.5
the query that i executed was
select classified from ModuleDVO as classified, CustomerGeographyDVO as cust where cust.geographyDVOs.countryDVO.countryName=:countryName and cust.geographyDVOs.id= classified.geographyid and cust.customerDVO.customerid=123456
The configuration is below
<class name="com.company.dept.project.core.dvo.CustomerGeographyDVO" table="bis_oblgo_curr_dim">
<id name="customerid" column="customerid">
<generator class="increment"/>
</id>
<one-to-one name="customerDVO" class="com.company.dept.project.core.dvo.CustomerDVO"/>
<set name="geographyDVOs" table="hr_geo_obligor_link" inverse="true">
<key column="customerid"/>
<one-to-many class="com.company.dept.project.core.dvo.CustomerGeographyLineItemDVO"/>
</set>
</class>
<class name="com.company.dept.project.core.dvo.CustomerGeographyLineItemDVO" table="hr_geo_obligor_link">
<id name="id" column="GEO_OBLIGOR_LINK_ID">
<generator class="increment"/>
</id>
<many-to-one name="countryDVO" column="GEOGRAPHY_ID" class="com.company.dept.project.core.dvo.CountryDVO"/>
</class>
<class name="com.company.dept.project.core.dvo.CustomerDVO" table="bis_oblgo_curr_dim">
<id name="customerid" column="customerid">
<generator class="increment"/>
</id>
<property name="name" type="string" column="customerid_LEG_NAM"/>
</class>
<class name="com.company.dept.project.core.dvo.CountryDVO" table="hr_geography">
<id name="id" column="GEOGRAPHY_ID">
<generator class="increment"/>
</id>
<property name="countryName" type="string" column="COUNTRY"/>
<property name="regionName" type="string" column="REGION"/>
</class>
<class name="com.company.dept.project.core.dvo.ModuleDVO" table="hr_class_info">
<id name="id" column="CLASS_INFO_ID">
<generator class="increment"/>
</id>
<property name="geographyid" type="int" column="GEO_OBLIGOR_LINK_ID"/>
<many-to-one name="statusDVO" class="com.company.dept.project.core.dvo.enumeratedtypes.StatusDVO" column="STATUS_TYPE"/>
</class>
select moduledvo0_.CLASS_INFO_ID as CLASS1_, moduledvo0_.GEO_OBLIGOR_LINK_ID as GEO2_3_, moduledvo0_.STATUS_TYPE as STATUS3_3_ from hr_class_info moduledvo0_, bis_oblgo_curr_dim customerge1_, hr_geo_obligor_link geographyd2_, hr_geography countrydvo3_, hr_geo_obligor_link geographyd4_ where customerge1_.customerid=geographyd4_.customerid and geographyd2_.GEOGRAPHY_ID=countrydvo3_.GEOGRAPHY_ID and customerge1_.customerid=geographyd2_.customerid and countrydvo3_.COUNTRY=? and geographyd4_.GEO_OBLIGOR_LINK_ID=moduledvo0_.GEO_OBLIGOR_LINK_ID and customerge1_.customerid=123456
I will really appreciate any pointers.
Thanks
Lachu
|