views:

193

answers:

1

Is it possible to configure Hibernate reverse engineering and code generation tool in such a way that one-to-many relation between tables is mapped to entities inheritance instead of enrites relation?

I have Person table and Employee table, which are related with the foreign key (Person contains basic information, Employee the rest). In my Java code I would like this relation mapped to inheritance Employee extends Person.

This can be done by hand, but maybe I missed some custom configuration parameter that I can use.

I couldn't find any official documentation - docs link on RedHat Hibernate page (http://www.hibernate.org/5.html#A10) is broken...

A: 

According to this (old) thread, this is not possible (and this more recent discussion suggest it's still not).

You'll have to modify the relevant templates (not sure how you can you can use a custom template for some tables only).

Pascal Thivent