-->
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: Autonaming of foreign key constraints
PostPosted: Tue Feb 24, 2004 5:33 pm 
Regular
Regular

Joined: Sat Oct 11, 2003 11:13 am
Posts: 69
When I execute the schemaexport, the generated DDL script contains cryptic foreign key constraint names like:

Quote:
alter table Address add index (PERSON_ID), add constraint FK1ED033D4D8F32245 foreign key (PERSON_ID) references Person (PERSON_ID);


The name FK1ED033D4D8F32245 starts good (FK), but ends bad (1ED033D4D8F32245).

Is there a feature with autonaming? I mean it would be good if the schemaexport could name the foreign key constraints automatically to FK_PERSON.

I tried to do it manually. It does not seem to work with Hibernate XDoclet tags:

Code:
   /**
     * @hibernate.set
     *  cascade="all"
     * @hibernate.collection-key
     *  column="PERSON_ID"
     * @hibernate.collection-one-to-many
     *  class="org.liberty.domainobjects.Address"
     *  foreign-key="FK_ADDRESS"
    * @return java.util.Set
    */
   public Set getAdresses() {
      return adresses;
   }


It had no effect on the generated hbm.xml file.[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 24, 2004 5:37 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Add this feature to Jira.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 24, 2004 5:48 pm 
Regular
Regular

Joined: Sat Oct 11, 2003 11:13 am
Posts: 69
emmanuel wrote:
Add this feature to Jira.


I did it. HB-742

Jira makes a much better impression than the tracking tool which we have to use in our company (a product called "Magic")!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 25, 2004 6:47 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I prefer Bugzilla for it's search capabilities, but JIRA for everything else.

_________________
Emmanuel


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.