-->
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: Complex mappging case
PostPosted: Sun Mar 23, 2008 5:45 pm 
Beginner
Beginner

Joined: Wed Mar 21, 2007 10:23 am
Posts: 20
Dear all,

My question is maybe closer to a conceptual point of view than to a real hibernate problem, but I think this is the right place to post it. My situation is the following :

* My class A implements the interface i
* My class B also implements the interface i
* My class C use either A or B through the interface i

* A and B need their own tables in the database

I easily see how to map the classes A and B as it is a basic case. But my question concern the association (many-to-one) between C and the classes A or B. How can I mention that the mapping class can be either A or B ? How can I manage the foreign key in this case ? When I talked about " conceptual point of view" I meant the situation could maybe be solved by re-factoring the problem's solution.



Thank you in advance for your answers.


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.