-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: How to apply unique constraint for multiple columns?
PostPosted: Fri May 06, 2005 5:17 am 
Beginner
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 06, 2005 6:35 am 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
http://forum.hibernate.org/viewtopic.php?t=939564


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 11, 2005 11:05 pm 
Beginner
Beginner

Joined: Thu Feb 26, 2004 6:59 am
Posts: 47
Location: Gurgaon, India
Thanks,

I am trying with the suggested solution.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.