-->
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: Middlegen generates only composite-ids
PostPosted: Tue Mar 29, 2005 11:06 am 
Beginner
Beginner

Joined: Sat Jan 01, 2005 12:18 pm
Posts: 23
I'm new to Middlegen and wanted to use it to create hbm.xml files out of a quite big legacy database.

I have got relations without keys defined in it and Middlegen generates composite-id's out of all attributes when no key is defined.

Is there any way to force Middlegen to create specified keys without to change the database schema?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 30, 2005 11:13 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
When it finds there is no primary key(s) defined it will generate a single large composite key since it has the best chance of being unique. The Relational model your using is not correct (which I sure you already know). It is too difficult (where the reality is i'm not motivated) to allow custom selection of fields that can pretend to be the primary key. I suggest you hand edit the table HBMs in question or better still add the primary constraints to the legacy database. Maybe you would be allowed to just change the development database to help.


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.