Hi
I am using Hibernate 3.1 and Weblogic 8. I have the following Hibernate Mappings
<?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 schema="HGAPPVRZ">
<class name="hibbertgroup.verizon.entity.NonCompCodes" table="VRZ_REBATE_NONCOMP_CODES">
<composite-id>
<key-property name="offerCode" column="OFFER_CODE" type="string" />
<key-property name="nonCompCode" column="NONCOMP_CODE" type="string"/>
</composite-id>
<property name="nonCompDesc" column="NONCOMP_CODE_DESC" type="string"/>
<property name="nonCompRMCDesc" column="NONCOMP_CODE_RMC_DESC" type="string"/>
<property name="nonCompCodeStatus" column="NONCOMP_STATUS" type="string"/>
</class>
</hibernate-mapping>
<?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 schema="HGAPPVRZ">
<class name="hibbertgroup.verizon.entity.DBNonComp" table="VRZ_REBATE_DB_NONCOMP">
<composite-id>
<key-property name="hibId" column="REBATE_HIB_ID" type="long" />
<key-property name="transSeq" column="TRANS_SEQ" type="integer"/>
<key-property name="nonCompCode" column="NONCOMP_CODE" type="string" />
</composite-id>
<many-to-one name="ncode" class="hibbertgroup.verizon.entity.NonCompCodes" update="false" insert="false" >
<column name="OFFER_CODE" />
<column name="NONCOMP_CODE" />
</many-to-one>
<property name="loadDate" column="LOAD_DATE" type="java.util.Date"/>
</class>
</hibernate-mapping>
Now, I am using the following Java code
Criteria dbNonCompCrit = sess.createCriteria(DBNonComp.class);
dbNonCompCrit.add(Expression.eq("hibId", new Long(hibid)));
dbNonCompCrit.addOrder(Order.asc("transSeq"));
Criteria nonCompCriteria = dbNonCompCrit.createCriteria("ncode");
The problem I am having is that hibernate executes the following query
select
this_.REBATE_HIB_ID as REBATE1_13_1_,
this_.TRANS_SEQ as TRANS2_13_1_,
this_.NONCOMP_CODE as NONCOMP3_13_1_,
this_.OFFER_CODE as OFFER4_13_1_,
this_.LOAD_DATE as LOAD5_13_1_,
noncompcod1_.NONCOMP_CODE as NONCOMP1_11_0_,
noncompcod1_.OFFER_CODE as OFFER2_11_0_,
noncompcod1_.NONCOMP_CODE_DESC as NONCOMP3_11_0_,
noncompcod1_.NONCOMP_CODE_RMC_DESC as NONCOMP4_11_0_,
noncompcod1_.NONCOMP_STATUS as NONCOMP5_11_0_
from
HGAPPVRZ.VRZ_REBATE_DB_NONCOMP this_, HGAPPVRZ.VRZ_REBATE_NONCOMP_CODES noncompcod1_
where
this_.NONCOMP_CODE=noncompcod1_.NONCOMP_CODE and
this_.OFFER_CODE=noncompcod1_.OFFER_CODE and this_.REBATE_HIB_ID=?
order by
this_.TRANS_SEQ asc
There is no OFFER_CODE for HGAPPVRZ.VRZ_REBATE_DB_NONCOMP table as well as no offerCode property for DBNonComp object
How can I fix this?
Thanks
Jay
|