I use Hibernate 2.0.3
I want make a one-to-many join with primary key and two column that aren't into primary key
Code:
table A
idNumber primary key
---------
date_end column
table B
idNumber
idTabB
---------
date_end column
class name="classA" table="A_RIFIUTI">
<composite-id name="id" class="PkclassA">
<key-property name="idNumber" column="idNumber" >
</composite-id>
<set name="chid" table="B" inverse="true" >
<key>
<column name="idNumber"/>
<column name="date_end"/> //this isn't into PK
</key>
<one-to-many class="classB"/>
</set>
....
I want a sql code like :
Code:
select * from B where idNumber=? and date_end=?
and I want that hibernate set data_end parameter equal at data_end parent value
Is it correct my mappling ?