-->
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: [Create DB Structure with Hibernate] Foreign key names
PostPosted: Mon Nov 13, 2006 5:00 am 
Newbie

Joined: Mon Nov 13, 2006 4:55 am
Posts: 3
Dear collegues !
we use hibernate for creating Database structure.
While the creation, for foreign key HIbernate uses names like FK8A84412B977E841 and so on. We suppose , Hibernate uses object hash codes or something like that, because when we add new column to a table the foreign key is also changed. Is It possible to make hibernate to use more friendly names ?

_________________
WBR
Eugene Veselov


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 13, 2006 7:59 am 
Expert
Expert

Joined: Tue Dec 07, 2004 6:57 am
Posts: 285
Location: Nürnberg, Germany
Hi,
this is possible by providing the foreign-key attribute. This is just a simple example using xml configuration:

Code:
<many-to-one name="propertyA" class="ClassA" column="PROP_A_ID" foreign-key="FK_PROP_A_ID"/>

_________________
Please don't forget to rate


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.