Hi, All
I have a parent-children relationship. I am going to use list rather than set or other types of collection for the mapping.
It seems that child class does not need a surrogate key as Hibernate will use parent id and index as composite primary key to identidy a child.
My child is a super class for a group of sub classes. I am going to use table-per-subclass mapping strategy rather than the table-per-class-hierachy strategy, as I don't want to change table schema when new sub classes being added.
A joined-subclass needs a key to link to its super class data row. As the super class has a composite primary key, I don't know how to specify the key in the joined-subclass.
I am learning Hibernate at this moment. Your answer will be much appreciated.
|