Hibernate version: 3.0
Mapping documents:
Code:
<hibernate-mapping package="mats.valueObject">
<class name="amts.valueObject.KodaacVO" table="TBL_KODAAC">
<id name="id" type="long" column="SEQ_IND" >
<generator class="sequence">
<param name ="sequence">KODAAC_SEQ</param>
</generator>
</id>
<property name="kodaac" type="java.lang.String" column="KODAAC" length="6"/>
<property name="building" type="java.lang.String" column="BUILDING" length="6"/>
<property name="mic" type="java.lang.String" column="MIC" length="3"/>
<join table="TBL_BUILDING" inverse="false">
<key column="building"/>
<property name="staging" type="yes_no" column="IS_STAGING" length="1" />
<property name="depacked" type="yes_no" column="DEPACK" length="1" />
</join>
</class>
</hibernate-mapping>
Name and version of the database you are using: Oracle 9i
The generated SQL (show_sql=true):Code:
SELECT this_.seq_ind AS seq1_0_, this_.kodaac AS kodaac3_0_,
this_.building AS building3_0_, this_.mic AS mic3_0_,
this_1_.is_staging AS is2_4_0_, this_1_.depack AS depack4_0_
FROM mill.tbl_kodaac this_ INNER JOIN mill.tbl_building this_1_ ON this_.seq_ind =
this_1_.building
WHERE this_.active = 'Y'
This is what I want...note the change is that instead of using the id (seq_ind) of
KodaacVO I want to use one of the columns (the building column):
Code:
SELECT this_.seq_ind AS seq1_0_, this_.kodaac AS kodaac3_0_,
this_.building AS building3_0_, this_.mic AS mic3_0_,
this_1_.is_staging AS is2_4_0_, this_1_.depack AS depack4_0_
FROM mill.tbl_dodaac this_ INNER JOIN mill.tbl_building this_1_ ON this_.building =
this_1_.building
WHERE this_.active = 'Y'
Is this possible to do? Any suggestions. Should I be using something other than a join?
thanks for all help,
Nate