-->
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: usage of constraint-name=".." in the newest nightl
PostPosted: Tue Apr 18, 2006 7:21 am 
Newbie

Joined: Tue Apr 18, 2006 6:11 am
Posts: 11
Hi,

I am using the latest nightly build from hibernate tools in order to get a correct naming of foreign-key properties.

Problem is that the generated properties are named in a not predictable manner as i want to do them.

There are 4 foreign keys in my table, if i put in one <foreign-key> fragment, the resulting property of the foreign key is generated correctly.

If I specify all four elements, one naming is always broken. I code them always in the same manner:

Code:
<foreign-key foreign-table="AUCTIONS" constraint-name="auction">
   <column-ref local-column="AUCTION_ID" foreign-column="ID" />
   <many-to-one property="auction" />
</foreign-key>


In this case I want to have the resulting property named "auction".

Do I make something wrong with the "constraint-name" attribute?
How do I have to handle it? Filling in the FK constraint here produces errors.
Other strings dont seem to affect anything, what is it for?

Thx for help,

cheers,

Gerald


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 8:24 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
in naming many-to-one and set the only thing that is used at the moment is the constraint-name.

This means that when the jdbcbinder processes the foreignkeys it asks the reverseengineering strategy what name it should use for this foreign key - and here the lookup is purely done on the constraint-name.

The issue then becomes that if you are *also* specifying foreign-table etc. you are actually (as it is now in the current release) ADDING a foreignkey constraint into the model that the jdbcbinder processes - and this end up resulting in a "wonderfull" mix of things.

Thus I would love if you could try doing your naming *without* foreign-table/column-ref and basically just use constraint-name and let me know if that works as you want it....and if it doesn't please submit a testcase to jira for me too look at.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 10:15 am 
Newbie

Joined: Tue Apr 18, 2006 6:11 am
Posts: 11
Ok..thx for helping out on this issue.

This works now if only specifying:

Code:
<foreign-key  constraint-name="LOT_AUCTION_FK">
       <many-to-one property="auction"/>
</foreign-key>


The editor marks the corresponding xml as an error, but that doesn`t matter.

cheers,

Gerald


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 10:29 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
it is just because the bundled dtd in the plugin is outofdate - will be fixed

_________________
Max
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.  [ 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.