Hello,
I have composite id, made up of two properties. One of which is a foreign key in the table, and the other which isn't.
<composite-id name="id" class="persistence.MatchExpulsionsId">
<key-property name="matchId" type="int">
<column name="MATCH_ID" />
</key-property>
<key-property name="expulsionNo" type="int">
<column name="EXPULSION_NO" />
</key-property>
</composite-id>
So, here it is easy to have MATCH_ID, because it is a foreign key from another relation.
I would like to have EXPULSION_NO automatically generated (increment)...so that it now looks like:
<composite-id name="id" class="persistence.MatchExpulsionsId">
<key-property name="matchId" type="int">
<column name="MATCH_ID" />
</key-property>
<key-property name="expulsionNo" type="int">
<column name="EXPULSION_NO" />
<generator class="increment" />
</key-property>
</composite-id>
Is there anyway to achieve this, or is there a workaround?
Many thanks.
|