#2441 Flatten and re-order if block in AssocOneHelpRefInherit when determining BeanDescriptor

This commit is contained in:
Rob Bygrave
2021-11-22 15:12:18 +13:00
parent b4403c58d1
commit 1114ccfb3a
@@ -32,16 +32,14 @@ final class AssocOneHelpRefInherit extends AssocOneHelp {
// read discriminator to determine the type
InheritInfo rowInheritInfo = inherit.readType(ctx);
BeanDescriptor<?> desc;
if (rowInheritInfo == null) {
if(!inherit.hasChildren()) {
desc = inherit.desc();
} else {
// ignore the id property
property.targetIdBinder.loadIgnore(ctx);
return null;
}
} else {
if (rowInheritInfo != null) {
desc = rowInheritInfo.desc();
} else if (!inherit.hasChildren()) {
desc = inherit.desc();
} else {
// ignore the id property
property.targetIdBinder.loadIgnore(ctx);
return null;
}
Object id = property.targetIdBinder.read(ctx);
if (id == null) {