-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Table Per Class Inheritance and Many-To-One to parent table?
PostPosted: Wed Feb 13, 2013 7:11 pm 
Newbie

Joined: Wed Feb 13, 2013 6:39 pm
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.