Beginner |
|
Joined: Tue Jul 25, 2006 12:34 pm Posts: 25
|
Hibernate version: 3
I have two tables: ActionBatch and Actions. ActionBatch has a numeric key, created by a generator class. That works fine. That ID then becomes the first part of the binary key for the table described below. The second field is basically the same as the batch in that it needs a generator class to populate it at save time. How do I describe such a key? In a separate class?
Mapping documents:
<class name="us.tx.state.oag.WfPersonnelAction.hbm.HbmWfPaActionTable"
table="info_wf_action">
<composite-id>
<key-property name="BatchId" column="batch_id" type="big_decimal"/>
<key-property name="ActionId" column="action_id" type="big_decimal"/>
</composite-id>
<property name="ActionTypeId" column="action_type_id" type="big_decimal" update="true" insert="true"/>
<property name="ActionTypeDesc" column="action_type_desc" type="string" update="true" insert="true"/>
<property name="Comments" column="comments" type="string" update="true" insert="true"/>
<property name="CreatedWho" column="cr_who" type="string" update="true" insert="true"/>
<property name="CreatedWhen" column="cr_when" type="timestamp" update="true" insert="true"/>
<property name="UpdatedWho" column="up_who" type="string" update="true" insert="true"/>
<property name="UpdatedWhen" column="up_when" type="timestamp" update="true" insert="true"/>
<!--
<many-to-one name="BatchId" column="batch_id" cascade="all" not-null="true" update="false" insert="false"
class="us.tx.state.oag.WfPersonnelAction.hbm.HbmWfPaActionBatchTable"/>
-->
</class>
|
|