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.
|
|