/** * INTERNAL: * Set the mappings. */ public void setMappings(Vector<DatabaseMapping> mappings) { // This is used from XML reader so must ensure that all mapping's descriptor has been set. for (Enumeration mappingsEnum = mappings.elements(); mappingsEnum.hasMoreElements();) { DatabaseMapping mapping = (DatabaseMapping)mappingsEnum.nextElement(); // For CR#2646, if the mapping already points to the parent descriptor then leave it. if (mapping.getDescriptor() == null) { mapping.setDescriptor(this); } } this.mappings = mappings; }
/** * PUBLIC: * Add a database mapping to the receiver. Perform any required * initialization of both the mapping and the receiving descriptor * as a result of adding the new mapping. */ public DatabaseMapping addMapping(DatabaseMapping mapping) { // For CR#2646, if the mapping already points to the parent descriptor then leave it. if (mapping.getDescriptor() == null) { mapping.setDescriptor(this); } getMappings().addElement(mapping); return mapping; }
mapping.setDescriptor(clonedDescriptor); mappingsVector.addElement(mapping);