-->
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.  [ 4 posts ] 
Author Message
 Post subject: How can I create a unique constraint for 2 or 3 columns?
PostPosted: Sun Mar 06, 2005 4:49 pm 
Newbie

Joined: Thu Jun 17, 2004 4:16 pm
Posts: 18
Hi all,

I am new to hibernate.

How can I create a unique constraint for a combination of two or three columns within mapping xml files?

I know how to declare a single property as unique but I don't know how to do the same with multiple columns.

Thank you in advance, kostas.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 06, 2005 4:52 pm 
Newbie

Joined: Sun Mar 06, 2005 5:41 am
Posts: 13
unique="true" in your <property/> tag


Top
 Profile  
 
 Post subject: How can I create a unique constraint for 2 or 3 columns?
PostPosted: Sun Mar 06, 2005 5:20 pm 
Newbie

Joined: Thu Jun 17, 2004 4:16 pm
Posts: 18
zegloman wrote:
unique="true" in your <property/> tag


I know how to do that.

If you read my question you will understand that I want to create a unique constraint for multiple properties.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 06, 2005 5:23 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
use <column unique-key="somename"/> on all properties.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.