}
return mapping;
}
private DatabaseMapping buildXMLObjectReferenceMapping(String mappingUri) {
XMLObjectReferenceMapping mapping = new XMLObjectReferenceMapping();
mapping.setAttributeName(getName());
if (getType().isDataObjectType()) {
((SDOType)getType()).setImplClassName(SDOConstants.SDO_DATA_OBJECT_IMPL_CLASS_NAME);
}
mapping.setReferenceClassName(((SDOType)getType()).getImplClassName());
mapping.setReferenceClass(((SDOType)getType()).getImplClass());
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;
}