-->
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: Specifying names for primary and unique key constraints?
PostPosted: Tue Jul 12, 2005 10:16 am 
Newbie

Joined: Wed May 18, 2005 4:50 am
Posts: 18
Hibernate version: 3.0.5

Using the attribute "foreign-key" in the mapping you can specify the name of the generated foreign key constraint.

Using the similar "unique-key" attribute seems only useful for grouping multiple columns in one constraint. The name specified is ignored. It's stated like this in the Hibernate reference too.

Is there a way to specify the names of the generated primary key and unique key constraints in the mapping documents?

If not, can anyone explain why?

Seems to me like this is something many people would need, e.g when reacting to a ConstraintViolationException.

Bye
Stefan


Top
 Profile  
 
 Post subject: primary key constraint name?
PostPosted: Tue Nov 15, 2005 10:39 am 
Newbie

Joined: Tue Nov 15, 2005 10:05 am
Posts: 9
Can no-one answer this?
The default SYS_Cnnnnnnnnn names cause real problems for support. Is there no way to name them explicitly in the hbm.xml file.

Also is it possible to specify and name a unique constraint on many-to-many link tables? This would seem to be a very common requirement.

Thanks for any insights
Mike


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.