Beginner |
|
Joined: Thu Feb 26, 2004 6:59 am Posts: 47 Location: Gurgaon, India
|
Hello,
I want to define a unique constraint for one of my object on more than one fields.
Like, data object is
Person extends Basic Object
First Name
Last Name
Age
Address
Now I want that First Name and Last Name should be unique.
I am using <properties> tag for this in the mapping.
<joined-subclass name='person' extends='basicObject'>
<key column='basicobject_id'>
<properties unique='true'>
<property name='firstname'>
<property name='lastname'>
<properties>
<joined class>
But properties tag is not supported for the joined subclasses.
Please suggest what should I do for applying this unique constraint.
Hibernate Version: 3.0
Thanks,
Mohit.
|
|