|
As I understand the (excellent!) Hibernate docs, to do a joined-subclass mapping (table-per-subclass mapping), I have to put the entire subclass mapping info inside the parent class mapping file in a joined-subclass element. This isn't just the subclass name, table, and key, but all the subclass properties, too.
When using a common, persistent base class ancestor that handles all the shadow information (versioning, timestamps, etc.), this implies that class mapping file will contain all the subclass keys, properties, etc. In this scenario, there will be one, potentially huge, mapping file for all persistent POJOs. Also, when a new subclass POJO is created, one needs to go back into the parent class mapping file and add all the subclass particulars.
Am I misunderstanding how to map the join-subclass? If not, this all has a distinctly non-OO feel about it, kind of like having to modify a base class every time a new subclass is created.
Can I achieve what appear to be the advantages of the join-subclass (i.e. cascading reads/updates/deletes of the ancestor data) while maintaining a separate mapping file for each POJO without manually managing all the ancestor persistence aloing with the subclass persistence?
Sorry if the answer is obvious; I'm just starting to explore Hibernate's capabilities.
All in all, Hibernate seems to be a truly wonderful creation! My hat's off to Gavin and Hibernate's contributors.
_________________ Jack
|