-->
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.  [ 2 posts ] 
Author Message
 Post subject: unique identifier - made up of a few attributes
PostPosted: Wed Feb 25, 2004 5:55 pm 
Newbie

Joined: Wed Feb 25, 2004 5:28 pm
Posts: 15
I want to have a unique identifier(UI) made up of three fields. UI has a lot of buisiness meaning and is therefore not suitable to be the primary key.

It seems to me I am looking for a UNIQUE = "true" for the component class ?

<component class="mypackage.UI" name="UI" UNIQUE = "true">
<property column="f1" name="f1" type="string"/>
<property column="f2" name="f2" type="string"/>
<property column="f3" name="f3" type="string"/>
</component>
But there isn't such a parameter.
Am I right about the idea of using "Component" and "unique"?

In other words, I wish to create a database contraint:
CREATE UNIQUE INDEX unique ON table_that_contains_UI (f1,f2,f3)

Is it ok to create my own database contraint after schema-export ?

I will be happy to receive any responses.
/Kwan


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 25, 2004 6:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Put unique-key="something" on all three property elements.


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