/** * INTERNAL: * Used to initialize a remote descriptor. */ public void remoteInitialization(DistributedSession session) { if (isChildDescriptor()) { if (session.hasCorrespondingDescriptor(getParentDescriptor())) { setParentDescriptor(session.getDescriptor(getParentClass())); } else { session.privilegedAddDescriptor(getParentDescriptor()); getParentDescriptor().remoteInitialization(session); } } Vector tempChildren = new Vector(getChildDescriptors().size()); Enumeration childEnum = getChildDescriptors().elements(); while (childEnum.hasMoreElements()) { ClassDescriptor childDescriptor = (ClassDescriptor)childEnum.nextElement(); if (session.hasCorrespondingDescriptor(childDescriptor)) { tempChildren.addElement(session.getDescriptor(childDescriptor.getJavaClass())); } else { session.privilegedAddDescriptor(childDescriptor); childDescriptor.remoteInitialization(session); tempChildren.addElement(childDescriptor); } } setChildDescriptors(tempChildren); }
/** * INTERNAL: * For an aggregate mapping the reference descriptor is cloned. * If the reference descriptor is involved in an inheritance tree, * all the parent and child descriptors are cloned also. * The cloned descriptors are then assigned primary keys and * table names before initialize. * This is a very specific behavior for aggregate mappings. */ public void initializeChildInheritance(ClassDescriptor parentDescriptor, AbstractSession session) throws DescriptorException { //recursive call to the further children descriptors if (parentDescriptor.getInheritancePolicy().hasChildren()) { //setFields(clonedChildDescriptor.getFields()); Vector childDescriptors = parentDescriptor.getInheritancePolicy().getChildDescriptors(); Vector cloneChildDescriptors = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(); for (Enumeration enumtr = childDescriptors.elements(); enumtr.hasMoreElements();) { ClassDescriptor clonedChildDescriptor = (ClassDescriptor)((ClassDescriptor)enumtr.nextElement()).clone(); clonedChildDescriptor.getInheritancePolicy().setParentDescriptor(parentDescriptor); initializeReferenceDescriptor(clonedChildDescriptor); clonedChildDescriptor.preInitialize(session); clonedChildDescriptor.initialize(session); translateFields(clonedChildDescriptor, session); cloneChildDescriptors.addElement(clonedChildDescriptor); initializeChildInheritance(clonedChildDescriptor, session); } parentDescriptor.getInheritancePolicy().setChildDescriptors(cloneChildDescriptors); } }
/** * INTERNAL: * Used to initialize a remote descriptor. */ public void remoteInitialization(DistributedSession session) { if (isChildDescriptor()) { if (session.hasCorrespondingDescriptor(getParentDescriptor())) { setParentDescriptor(session.getDescriptor(getParentClass())); } else { session.privilegedAddDescriptor(getParentDescriptor()); getParentDescriptor().remoteInitialization(session); } } Vector tempChildren = new Vector(getChildDescriptors().size()); for (ClassDescriptor childDescriptor : getChildDescriptors()) { if (session.hasCorrespondingDescriptor(childDescriptor)) { tempChildren.addElement(session.getDescriptor(childDescriptor.getJavaClass())); } else { session.privilegedAddDescriptor(childDescriptor); childDescriptor.remoteInitialization(session); tempChildren.addElement(childDescriptor); } } setChildDescriptors(tempChildren); }
/** * INTERNAL: * Used to initialize a remote descriptor. */ public void remoteInitialization(DistributedSession session) { if (isChildDescriptor()) { if (session.hasCorrespondingDescriptor(getParentDescriptor())) { setParentDescriptor(session.getDescriptor(getParentClass())); } else { session.privilegedAddDescriptor(getParentDescriptor()); getParentDescriptor().remoteInitialization(session); } } Vector tempChildren = new Vector(getChildDescriptors().size()); for (ClassDescriptor childDescriptor : getChildDescriptors()) { if (session.hasCorrespondingDescriptor(childDescriptor)) { tempChildren.addElement(session.getDescriptor(childDescriptor.getJavaClass())); } else { session.privilegedAddDescriptor(childDescriptor); childDescriptor.remoteInitialization(session); tempChildren.addElement(childDescriptor); } } setChildDescriptors(tempChildren); }
/** * Hook together the inheritance policy tree. */ protected void preInitializeInheritancePolicy(AbstractSession session) throws DescriptorException { if (isChildDescriptor() && (requiresInitialization())) { if (getInheritancePolicy().getParentClass().equals(getJavaClass())) { setInterfaceInitializationStage(ERROR); throw DescriptorException.parentClassIsSelf(this); } ClassDescriptor parentDescriptor = session.getDescriptor(getInheritancePolicy().getParentClass()); parentDescriptor.getInheritancePolicy().addChildDescriptor(this); getInheritancePolicy().setParentDescriptor(parentDescriptor); parentDescriptor.preInitialize(session); } }
/** * Hook together the inheritance policy tree. */ protected void preInitializeInheritancePolicy(AbstractSession session) throws DescriptorException { if (isChildDescriptor() && (requiresInitialization(session))) { if (getInheritancePolicy().getParentClass().equals(getJavaClass())) { setInterfaceInitializationStage(ERROR); throw DescriptorException.parentClassIsSelf(this); } ClassDescriptor parentDescriptor = session.getDescriptor(getInheritancePolicy().getParentClass()); parentDescriptor.getInheritancePolicy().addChildDescriptor(this); getInheritancePolicy().setParentDescriptor(parentDescriptor); parentDescriptor.preInitialize(session); } }
/** * INTERNAL: * For an aggregate mapping the reference descriptor is cloned. * If the reference descriptor is involved in an inheritance tree, * all the parent and child descriptors are cloned also. * The cloned descriptors are then assigned primary keys and * table names before initialize. * This is a very specific behavior for aggregate mappings. */ public void initializeChildInheritance(ClassDescriptor parentDescriptor, AbstractSession session) throws DescriptorException { //recursive call to the further children descriptors if (parentDescriptor.getInheritancePolicy().hasChildren()) { //setFields(clonedChildDescriptor.getFields()); List<ClassDescriptor> childDescriptors = parentDescriptor.getInheritancePolicy().getChildDescriptors(); List<ClassDescriptor> cloneChildDescriptors = new ArrayList(); for (ClassDescriptor child : childDescriptors) { ClassDescriptor clonedChildDescriptor = (ClassDescriptor)child.clone(); clonedChildDescriptor.getInheritancePolicy().setParentDescriptor(parentDescriptor); initializeReferenceDescriptor(clonedChildDescriptor, session); clonedChildDescriptor.preInitialize(session); clonedChildDescriptor.initialize(session); translateFields(clonedChildDescriptor, session); cloneChildDescriptors.add(clonedChildDescriptor); initializeChildInheritance(clonedChildDescriptor, session); } parentDescriptor.getInheritancePolicy().setChildDescriptors(cloneChildDescriptors); } }
/** * INTERNAL: * For an aggregate mapping the reference descriptor is cloned. * If the reference descriptor is involved in an inheritance tree, * all the parent and child descriptors are cloned also. * The cloned descriptors are then assigned primary keys and * table names before initialize. * This is a very specific behavior for aggregate mappings. */ public void initializeChildInheritance(ClassDescriptor parentDescriptor, AbstractSession session) throws DescriptorException { //recursive call to the further children descriptors if (parentDescriptor.getInheritancePolicy().hasChildren()) { //setFields(clonedChildDescriptor.getFields()); List<ClassDescriptor> childDescriptors = parentDescriptor.getInheritancePolicy().getChildDescriptors(); List<ClassDescriptor> cloneChildDescriptors = new ArrayList(); for (ClassDescriptor child : childDescriptors) { ClassDescriptor clonedChildDescriptor = (ClassDescriptor)child.clone(); clonedChildDescriptor.getInheritancePolicy().setParentDescriptor(parentDescriptor); initializeReferenceDescriptor(clonedChildDescriptor, session); clonedChildDescriptor.preInitialize(session); clonedChildDescriptor.initialize(session); translateFields(clonedChildDescriptor, session); cloneChildDescriptors.add(clonedChildDescriptor); initializeChildInheritance(clonedChildDescriptor, session); } parentDescriptor.getInheritancePolicy().setChildDescriptors(cloneChildDescriptors); } }
/** * Hook together the inheritance policy tree. */ protected void preInitializeInheritancePolicy(AbstractSession session) throws DescriptorException { if (isChildDescriptor() && (requiresInitialization(session))) { if (getInheritancePolicy().getParentClass().equals(getJavaClass())) { setInterfaceInitializationStage(ERROR); throw DescriptorException.parentClassIsSelf(this); } ClassDescriptor parentDescriptor = session.getDescriptor(getInheritancePolicy().getParentClass()); parentDescriptor.getInheritancePolicy().addChildDescriptor(this); getInheritancePolicy().setParentDescriptor(parentDescriptor); parentDescriptor.preInitialize(session); } }
clonedChildDescriptor.getInheritancePolicy().setParentDescriptor(parentDescriptor); clonedChildDescriptor.preInitialize(session); clonedChildDescriptor.initialize(session);
clonedChildDescriptor.getInheritancePolicy().setParentDescriptor(parentDescriptor); clonedChildDescriptor.preInitialize(session); clonedChildDescriptor.initialize(session);
clonedChildDescriptor.getInheritancePolicy().setParentDescriptor(parentDescriptor); clonedChildDescriptor.preInitialize(session); clonedChildDescriptor.initialize(session);
Class parentClass = parentType.getImplClass(); getXmlDescriptor().getInheritancePolicy().setParentClass(parentClass); getXmlDescriptor().getInheritancePolicy().setParentDescriptor(parentType.getXmlDescriptor()); parentType.getXmlDescriptor().getNamespaceResolver().put(XMLConstants.SCHEMA_INSTANCE_PREFIX, javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI); getXmlDescriptor().getNamespaceResolver().put(XMLConstants.SCHEMA_INSTANCE_PREFIX, javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI);
Class parentClass = parentType.getImplClass(); getXmlDescriptor().getInheritancePolicy().setParentClass(parentClass); getXmlDescriptor().getInheritancePolicy().setParentDescriptor(parentType.getXmlDescriptor()); parentType.getXmlDescriptor().getNamespaceResolver().put(XMLConstants.SCHEMA_INSTANCE_PREFIX, javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI); getXmlDescriptor().getNamespaceResolver().put(XMLConstants.SCHEMA_INSTANCE_PREFIX, javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI);