return value;
}
}
}
if(primaryKey.getPrimaryKey()[0] != null){
XMLMarshalException e = XMLMarshalException.missingIDForIDRef(Object.class.getName(), primaryKey.getPrimaryKey());
if(handler != null){
SAXParseException saxParseException = new SAXParseException(e.getLocalizedMessage(), null, e);
try{
handler.warning(saxParseException);
}catch(SAXException saxException){
throw e;
}
}
}
return null;
} else {
Object value = getValue(referenceTargetClass, primaryKey);
if(null == value) {
DatabaseMapping mapping = (DatabaseMapping) reference.getMapping();
ClassDescriptor targetDescriptor = mapping.getReferenceDescriptor();
if(targetDescriptor.hasInheritance()) {
InheritancePolicy inheritancePolicy = targetDescriptor.getInheritancePolicy();
List<ClassDescriptor> childDescriptors = inheritancePolicy.getAllChildDescriptors();
for(ClassDescriptor childDescriptor : childDescriptors) {
value = getValue(childDescriptor.getJavaClass(), primaryKey);
if(null != value) {
return value;
}
}
}
}
if(value == null && (primaryKey.getPrimaryKey()[0] != null) ){
XMLMarshalException e = XMLMarshalException.missingIDForIDRef(referenceTargetClass.getName(), primaryKey.getPrimaryKey());
if(handler != null){
SAXParseException saxParseException = new SAXParseException(e.getLocalizedMessage(), null, e);
try{
handler.warning(saxParseException);
}catch(SAXException saxException){
throw e;
}