-->
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.  [ 3 posts ] 
Author Message
 Post subject: I don't want many-to-one. I want regular property field.
PostPosted: Tue Dec 27, 2005 4:22 pm 
Newbie

Joined: Tue Dec 27, 2005 4:09 pm
Posts: 1
Hi

I'm using Hibernate Tool 3.1 beta2. I used the Hibernate Code Generation Tool to create hbm.xml mapping file & .java files. I understand that whenever there is a relationship in the table, the Code Generation tool automatically creates many-to-one relation ships.
But sometimes I don't want that relationship.
How can I override the reverse engineering file (reveng.xml) to have regular "property" field instead of many-to-one "object" field? I couldn't figure out how to do it.

If it is not supported in this version, what other tool would you recommend to create the hbm.xml and .java files.

Thank you in advance.
.


Top
 Profile  
 
 Post subject: handcode
PostPosted: Tue Dec 27, 2005 4:58 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
I would suggest using code generation tool only once to create a first draft of mapping files and classes and then manually tweak it to the exact requirements of the application. And maintaining those mapping files manually is not that hard IMO, and vastly more reliable and predictable.

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 27, 2005 5:56 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you can't do this via the reveng.xml file (yet), but you can control it your self by providing a custom ReverseEngineeringStrategy that does not return the foreign keys you don't like.

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