-->
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: reveng.xml subclass generation
PostPosted: Tue Nov 27, 2007 2:35 pm 
Newbie

Joined: Thu Jun 23, 2005 12:25 pm
Posts: 7
I am using the hibernate tools to reverse engineer from an oracle database. I am using only the reveng.xml file and going directly to the POJOs.

I have a supertype and subtype in the database that I want to reflect as a superclass and subclass in the java generation. Is there anyway to do this within the reveng.xml file. I have added in the <meta attribute="extends"/> tag and it will generate this correctly, but will still include the primary key from the superclass.

I want to have the superclass have the unique identifier and the subclass inherit this identifier as well. The generation includes this key and there is no way that I have found to exclude this column in a subclass generation. It also does composition with the superclass which it doesn't need to do with java inheritance.

Any suggestions?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 27, 2007 4:39 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the reveng engine does not (yet) have support for modelling inheritance.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 27, 2007 5:07 pm 
Newbie

Joined: Thu Jun 23, 2005 12:25 pm
Posts: 7
Is this part of the road map and if so do you have a time frame that this will be implemented?

Also is there another workaround that can be done without manually pulling out the unnecessary code?

Thank you for the help.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 28, 2007 3:14 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Manual workaround -> manually adjust the code (maybe you can adjust the templates too to skip the id generation in case of "extends" existing - thats a hack though ;)

road map -> it's been asked before and I always said that if someone finds a good way of doing it without actually reinventing the mapping files in reveng.xml then we could do it. The problem is just that if it becomes too easy to do it too many people will just rely on reveng to do all their mappings and no realize that they are most likely running with very suboptimal mappings (on the other hand it would also be good that reveng.xml would allow you to tweak enough to be ok....but then things like specifying cascades would be much more relevant)

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