jadeite100 (18) [Avatar] Offline
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.


Zolar (2) [Avatar] Offline
Re: Mapping class inheritance

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


Hope this can help.
bklough (7) [Avatar] Offline
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:


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.