-->
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: unique index on multiple columns
PostPosted: Sun Jan 18, 2004 9:34 am 
Pro
Pro

Joined: Mon Sep 08, 2003 4:30 pm
Posts: 203
Hi all,

Can Hibernate generate a unique index based on multiple columns?
I don't want to use composite id, but native generated id(key).

Basically, what I want to achieve, is to ensure unique records in the DB based on a set of columns, w/out composite keys.

TIA,
--steve p.


Top
 Profile  
 
 Post subject: Re: unique index on multiple columns
PostPosted: Fri Feb 13, 2004 9:59 pm 
Newbie

Joined: Fri Nov 21, 2003 6:07 am
Posts: 2
Has this problem resolved? I also interest it.

thanks everyone in advance.

dia100 wrote:
Hi all,

Can Hibernate generate a unique index based on multiple columns?
I don't want to use composite id, but native generated id(key).

Basically, what I want to achieve, is to ensure unique records in the DB based on a set of columns, w/out composite keys.

TIA,
--steve p.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 14, 2004 9:46 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
http://www.hibernate.org/hib_docs/reference/html/toolsetguide.html#toolsetguide-s1-2 - use unique-key I suppose


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 11, 2004 12:53 pm 
Newbie

Joined: Mon Mar 01, 2004 3:41 pm
Posts: 9
Hi,

Related to the issue, it seems neither the unique attribute nor the unique-key attribute works in many-to-one mapping:

<many-to-one name="manufacturer" class="data.Manufacturer" column="manufacturer_id" >
<column name="manufacturer_id" unique="true" unique-key="mfmodel" />
</many-to-one>

The unique constraint doesn't appear in the generated ddl at all.

Is there anything wrong in the mapping?

Thanks a lot in advance!


michael wrote:


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.