I have a database schema with parent table A and tables B, C, and D each with a foreign key pointing to table A. In this particular case, inheritance would fit really well. Tables B, C, and D would inherit from table A in a "table per subclass" strategy. The only problem I see is that table B requires that multiple records be able point to a single record in table A (i.e. a many-to-one relationship).
Is it possible to have an inheritance model like this in Hibernate but also have the ability to have a many-to-one relationship from a subtable/subclass to the parent table in the database? If so, how can this be done with annotations (or xml if that is the only way it could be done)? I've tried searching for information on this type of scenario but can't find any examples.
|