Hi, i'm a student and i need help for Reverse Engineering with inheritance.
Premise:
Hibernate supports the three basic inheritance mapping strategies:
table per class hierarchy table per subclass table per concrete class
My problem:
With the Reverse Engineering of Hibernate (via the tools provided by Eclipse), I would like to generate both the mapping files that classes from an existing database. In the case of inheritance, things get more complex. I wish everything was automatic. I'm trying to deal with the three cases separately:
table for class hierarchy
In this case, I have a table for the entire hierarchy. The ideal would be to split the table into multiple classes, but neither it nor the Strategy and Reveng.xml allows me to do this. How can I fix?
table for subclass
In this case I used the meta file reveng.xml (in particular, extends, and the exclude to exclude attributes that are foreign keys). Once generated classes I change back the xml file by entering the tag <joined-subclass>. But there is a different way easier and more automatic?
table for concrete class
In this case I used the meta file reveng.xml (in particular, extends, and to exclude the attributes repeated in child classes). Once generated classes I change back the xml file by entering the tag <union-subclass>. But there is a different way easier and more automatic? However, there remains the problem related to the case of abstract base class that does not have a corresponding table. How can I fix?
|