-->
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.  [ 1 post ] 
Author Message
 Post subject: Foreign key constraint names - ImprovedNamingStrategy
PostPosted: Thu Apr 10, 2008 11:33 am 
Beginner
Beginner

Joined: Thu Nov 16, 2006 11:34 am
Posts: 26
Location: Boston
Hibernate version:
3.3.1
Mapping documents:
Annotations

Name and version of the database you are using:
Oracle 10g & Mysql 5

I've extended ImprovedNamingStrategy for generating automatic table plurals. I understand how to extend other methods as well, however, it looks like there is no method to override Foreign Key Constraints. Look at the constraint names in the sql generated by hbm-ddl in a sample mysql database for the table - abc_performances.

KEY `FKE581A57DE96031D4` (`performance_id`),
CONSTRAINT `FKE581A57DE96031D4` FOREIGN KEY (`performance_id`) REFERENCES `performances` (`id`)

Ideally, I would like the standard naming convention as
FK_PARENTTABLENAME_CHILDTABLE_NAME

Is there anyway, this could be achieved? (as an overriding method in NamingStrategy Interface)


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

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.