Hi guys,
I'm using latest version of Hibernate
here's what I wanna do and how I figure out I should implement the mapping:
I have a bottom-up approach in my app, this is why i'm starting from the Tables
I want to have a table A that can have a reference to B OR C.
As I don't wan't to use nullable FK, i'm using an association that is composed of (ID_A, TYPE, ID), Type being B or C.
It works fine from a relational point of view.
Now the Hibernate documentation on ternary associations is rather slim... so I need some help on this point!
How shall I best implement the corresponding mapping?
What are the possibilities offered by Hibernate?
|