How do I define hibernate mapping if I have more then one unique-key for the same field ie if I want to generate DDL with two unique constrain For eg. I have unique constrain for type and key2 fields defined by unique-key="key2type". If I also want to define unique constrain for type and key1 field how do I write it.
I want to write hibernate mapping so that I can generate DDL with 2 unique constrain. Unique (key1,type) and also Unique(key2,type)
Any help will be appreciated
<many-to-one name="type" class="com.db.Type">
<column name="type" index="key2type" unique-key="key2type"/>
</many-to-one>
<property name="key1" type="string">
<column name="key1" index="key1"/>
</property>
<property name="key2" type="string">
<column name="key2" index="key2" unique-key="key2type" not-null="true"/>
</property>
Last edited by swarnim on Sat Dec 02, 2006 12:11 pm, edited 1 time in total.
|