-->
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.  [ 1 post ] 
Author Message
 Post subject: Strange problem: same table is linked twice in the sql query
PostPosted: Wed Oct 12, 2005 7:16 pm 
Newbie

Joined: Wed Oct 12, 2005 7:06 pm
Posts: 10
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.