* Otherwise the processing of those accessor will only be performed once
* by their 'real' owning entity accessor.
*/
public void addTablePerClassParentMappings(MetadataDescriptor startingDescriptor, MetadataDescriptor realDescriptor) {
EntityAccessor reloadedParentEntity = null;
MetadataDescriptor realParentDescriptor = null;
// If we are an inheritance subclass, recursively call up to the root
// entity so that we can grab a copy of all our inherited mapping
// accessors. Copies of our parent accessors are done by reloading the
// parent entities through OX (if they were originally loaded from XML).
// This is our way of cloning. The reloaded accessors are rebuilt using
// the startingDescriptor context, that is where we want to add the
// accessors.
if (realDescriptor.isInheritanceSubclass() && realDescriptor.getInheritanceRootDescriptor().usesTablePerClassInheritanceStrategy()) {
realParentDescriptor = realDescriptor.getInheritanceParentDescriptor();
reloadedParentEntity = reloadEntity((EntityAccessor) realParentDescriptor.getClassAccessor(), startingDescriptor);
addTablePerClassParentMappings(startingDescriptor, realParentDescriptor);
}
// If we are the starting entity, the processing of our mapped
// superclass and our accessors will be done when we process our
// immediate accessors. Also, our immediate mapped superclasses will
// have other metadata for us to process (and not just the addition of
// accessors). See EntityAccesor process() and processClassMetadata().
if (reloadedParentEntity != null) {
// Be sure to reload the mapped superclass from the 'real' entity
// accessor which has already discovered the list.
EntityAccessor realParentEntityAccessor = (EntityAccessor) realParentDescriptor.getClassAccessor();
for (MappedSuperclassAccessor mappedSuperclass : realParentEntityAccessor.getMappedSuperclasses()) {
// Reload the mapped superclass and add its accessors.
reloadMappedSuperclass(mappedSuperclass, startingDescriptor).addAccessors();
}