#1837 (#1740 and #1744) - Inheritance on both sides of @ManyToOne

This change also relates back to #1740 and #1744 and changes the way that issue was fixed (by SqlTreeNodeBean on partially populated non-id inheritance bean).
This commit is contained in:
rob bygrave
2019-10-13 11:46:11 +13:00
parent a474880735
commit f24b4dba71
10 changed files with 21 additions and 42 deletions
@@ -227,7 +227,7 @@ class SqlTreeNodeBean implements SqlTreeNode {
@Override
void initBeanType() throws SQLException {
InheritInfo localInfo = inheritInfo.readType(ctx);
InheritInfo localInfo = readId ? inheritInfo.readType(ctx) : desc.getInheritInfo();
if (localInfo == null) {
// the bean must be null
localIdBinder = idBinder;
@@ -539,7 +539,7 @@ class SqlTreeNodeBean implements SqlTreeNode {
}
if (readId) {
if (!subQuery && inheritInfo != null && inheritInfo.hasChildren()) {
if (!subQuery && inheritInfo != null) {
ctx.appendColumn(inheritInfo.getDiscriminatorColumn());
}
appendSelectId(ctx, idBinder.getBeanProperty());