The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

jadeite100 (18) [Avatar] Offline
#1
Hi All:

From page 97 to page 104 in "Hibernate In Action" it talks about Mapping class inheritance. The three ways of mapping class inheritance are:

1.)Table per concrete class

2.)Table per class hierarchy

3.)Table per subclass

Does anybody know how to generate the hbm.xml files using either of the following mapping class inheritance using either Xdoclet or some other tools. If some other tools can generate the hbm.xml files for class inheritance can somebody give me directions where I can get this tool and how to use this tool

Does anybody know of any url that has good examples of Hibernate Mapping Class Inheritance.



Any help would be greatly appreciated.



Yours,



Desperate.
Zolar (2) [Avatar] Offline
#2
Re: Mapping class inheritance
Hi,

There is a tool called "Middelgen" and a tutorial which can be found in the following address:

http://www.warfrog.com/hibernatetutorial/

Hope this can help.
Regards,
Zolar
bklough (7) [Avatar] Offline
#3
Re: Mapping class inheritance
It's easier to write the hbm.xml by hand. MiddleGen appears to be the "Ugly step sibling", near as I can tell. I'm sure it's a great tool under a master's hand, but, left to it's own devices, it generates some really funky code. If you're like the rest of us, you probably don't have the time to dump learning an outdated tool.

For those checking out this ancient post with it's outdated reply, first, scan this:

http://www.agiledata.org/essays/mappingObjects.html

It will help in bridging the OO to RDB gap. If there's an essence of "grok" felt, move onto the Hibernate books. Pay particular attention to Identity and Equality as they related to the database, where mentioned (they need more ddl code to match their other examples). Should find your happy place somewhere along the way.