.arg(propertyVar));
}
private Property findReferencedIdProperty(Property property) {
// find referenced bean
Bean targetBean = model.getBean(toClass(property.getComponentType()));
if (targetBean == null) {
throw new BuildException("Unknown bean " + toClass(property.getType()));
}
// find id property on referenced bean
Property idProperty = null;
while (idProperty == null) {
for (Property targetProperty : targetBean.getProperties()) {
if (targetProperty.isId()) {
idProperty = targetProperty;
break;
}
}
if (idProperty == null) {
if (targetBean.getBaseClass() == null) {
throw new BuildException("Property " + property + " is an IDREF, but property type " + toClass(property.getType()).getName() + " does not have an ID property");
}
targetBean = targetBean.getBaseClass();
}
}
return idProperty;
}