private void addChoiceElementMapping(List<XMLField> sourceFields, Class theClass, List<XMLField> targetFields) { XMLCollectionReferenceMapping xmlMapping = new XMLCollectionReferenceMapping(); xmlMapping.setReferenceClass(theClass); xmlMapping.setAttributeAccessor(temporaryAccessor); for(int i = 0; i < sourceFields.size(); i++) { XMLField sourceField = sourceFields.get(i); xmlMapping.addSourceToTargetKeyFieldAssociation(sourceField, targetFields.get(i)); this.choiceElementMappings.put(sourceField, xmlMapping); } this.choiceElementMappingsByClass.put(theClass, xmlMapping); }
private DatabaseMapping buildXMLCollectionReferenceMapping(String mappingUri) { XMLCollectionReferenceMapping mapping = new XMLCollectionReferenceMapping(); mapping.setAttributeName(getName()); if (getType().isDataObjectType()) { getType().setImplClassName(SDOConstants.SDO_DATA_OBJECT_IMPL_CLASS_NAME); } mapping.setReferenceClassName(getType().getImplClassName()); mapping.setReferenceClass(getType().getImplClass()); mapping.setUsesSingleNode(true); mapping.useCollectionClass(ArrayList.class); String sourcexpath = getQualifiedXPath(getContainingType().getURI(), true); // Get reference ID property if it exists SDOProperty targetIDProp = getIDProp(getType()); if (targetIDProp != null) { String targetxpath = targetIDProp.getQualifiedXPath(getType().getURI(), true); mapping.addSourceToTargetKeyFieldAssociation(sourcexpath, targetxpath); } else { throw SDOException.noTargetIdSpecified(getType().getURI(), getType().getName()); } return mapping; }
private DatabaseMapping buildXMLCollectionReferenceMapping(String mappingUri) { XMLCollectionReferenceMapping mapping = new XMLCollectionReferenceMapping(); mapping.setAttributeName(getName()); if (getType().isDataObjectType()) { getType().setImplClassName(SDOConstants.SDO_DATA_OBJECT_IMPL_CLASS_NAME); } mapping.setReferenceClassName(getType().getImplClassName()); mapping.setReferenceClass(getType().getImplClass()); mapping.setUsesSingleNode(true); mapping.useCollectionClass(ArrayList.class); String sourcexpath = getQualifiedXPath(getContainingType().getURI(), true); // Get reference ID property if it exists SDOProperty targetIDProp = getIDProp(getType()); if (targetIDProp != null) { String targetxpath = targetIDProp.getQualifiedXPath(getType().getURI(), true); mapping.addSourceToTargetKeyFieldAssociation(sourcexpath, targetxpath); } else { throw SDOException.noTargetIdSpecified(getType().getURI(), getType().getName()); } return mapping; }
private void addChoiceElementMapping(List<XMLField> sourceFields, Class theClass, List<XMLField> targetFields) { XMLCollectionReferenceMapping xmlMapping = new XMLCollectionReferenceMapping(); xmlMapping.setReferenceClass(theClass); xmlMapping.setAttributeAccessor(temporaryAccessor); for(int i = 0; i < sourceFields.size(); i++) { XMLField sourceField = sourceFields.get(i); xmlMapping.addSourceToTargetKeyFieldAssociation(sourceField, targetFields.get(i)); this.choiceElementMappings.put(sourceField, xmlMapping); } this.choiceElementMappingsByClass.put(theClass, xmlMapping); }
private void addChoiceElementMapping(XMLField sourceField, Class theClass, XMLField targetField) { XMLCollectionReferenceMapping mapping = new XMLCollectionReferenceMapping(); mapping.setReferenceClass(theClass); mapping.setAttributeAccessor(temporaryAccessor); mapping.addSourceToTargetKeyFieldAssociation(sourceField, targetField); this.choiceElementMappings.put(sourceField, mapping); this.choiceElementMappingsByClass.put(theClass, mapping); }
private void addChoiceElementMapping(XMLField sourceField, Class theClass, XMLField targetField) { XMLCollectionReferenceMapping mapping = new XMLCollectionReferenceMapping(); mapping.setReferenceClass(theClass); mapping.setAttributeAccessor(temporaryAccessor); mapping.addSourceToTargetKeyFieldAssociation(sourceField, targetField); this.choiceElementMappings.put(sourceField, mapping); this.choiceElementMappingsByClass.put(theClass, mapping); }