Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do TopLink inheritance mappings compare with Java class inheritance?

0
Posted

How do TopLink inheritance mappings compare with Java class inheritance?

0

To map a Java inheritance hierarchy in TopLink, each class in the hierarchy will define a TopLink descriptor. Each subclass’ descriptor will define its parent to be its superclass. This inheritance hierarchy can be reflected in the database in many ways. TopLink requires a common table for the root class that must be shared by all of the subclasses. The subclasses are free to define additional tables to store their additional data or can share their parent’s tables. TopLink uses an indicator field in the root table to determine the class to instantiate from the row, however this mechanism can be customized if required. It is a common misconception that a system with a root domain class must be mapped using this kind of inheritance mapping. Typically this should only be done where the database schema dictates or the object model allows similar types to be stored together. If it does not make sense to define a table for the root class, this class can not be mapped at all, or can be mappe

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.