eagle79 wrote:
Quote:
different parents can have same IDs
So how do you identify a specific parent? Put another way, what is the primary key of a parent? If different parents can have the same ID, you have bigger problems, because you can never retrieve a particular parent.
Each parent has its own table. Each parent's ID is generated as follows:
<id name="id" type="long" column="ID">
<generator class="native"/>
</id>
So it is apparent that different parents can have same ID numbers because they come from differnent tables/classes. There is no problem for using ID for each parent individually. The problem is how to identify the parent for a child when multiple parents share the same Child table.
That is why I am thinking about using each parent's class name as an additional element.
If each parent used "uuid.hex" instead of "native", I would have no problem at all in writing Hibernate mapping file. Now each parent uses a
number.
If "uuid.hex" is the only option, it seems to me that Hibernate misses something or not so powerful in mapping. Maybe I am wrong.