Hello,
I have a mapping that contains a
composite id with two keys. I require something like
different genertors for the two keys;
foreign for first key and assigned for the second key. The relevant section from the mapping file is as follows:-
Code:
<hibernate-mapping auto-import="false">
<class name="abc.UserContactInfo" table="USER_CONTACT_INFO">
<composite-id name="id" class="abc.UserContactInfoId">
<!-- Foreign generator with property as userPersonalInfo -->
<key-property name="userId" type="string">
<column name="USER_ID" length="40" />
</key-property>
<!-- assigned generator, set on the object -->
<key-property name="type" type="string">
<column name="TYPE" length="10" />
</key-property>
</composite-id>
<many-to-one name="userPersonalInfo" class="abc.UserPersonalInfo" update="false" insert="false" fetch="select">
<column name="USER_ID" length="40" not-null="true" />
</many-to-one>
How can I get my composite id generation to be a mix of foreign and assigned i.e
foreign for the first key and assigned for the second key.
Thanks,
Nikhil