Dear all,
I have a one-to-many foreign key associated tables auto populate problem. (I want all the associated tables to get the Parent table's PK. My 1 Parent has 3 children).
Code:
<hibernate-mapping>
<class name="TransactionTableVO" table="TRANSACTION_TABLE">
<id name="txnId" type="java.lang.String" column="TRANSACTION_ID" >
<generator class="sequence">
<param name="sequence">cdhc.transaction_id_seq</param>
</generator>
</id>
<set name="txnSharedAccSet" cascade="save-update">
<key column="TRANSACTION_ID"/>
<one-to-many class="TxnSharedAccumulatorVO" />
</set>
...
and the TransactionTableVO class has this:
private Set txnSharedAccSet;
public Set getTxnSharedAccSet() {
return txnSharedAccSet;
}
public void setTxnSharedAccSet(Set txnSharedAccSet) {
this.txnSharedAccSet = txnSharedAccSet;
}
Code:
<hibernate-mapping>
<class name="TxnSharedAccumulatorVO" table="TXN_SHARED_ACCUMULATOR">
<id name="txnId" column="TRANSACTION_ID" >
<generator class="foreign">
<param name="property">txnTbleVo</param>
</generator>
</id>
<many-to-one name="txnTbleVo" class="TransactionTableVO" />
...
And of course, it does not work!!
I am setting the TransactionTableVO's values, which includes the txnSharedAccSet. Is there anything that I"m missing please?
Thanks a lot for your help!
-Vg