#1372 - Missing @OneToOne mapping yields unusable error messages.

This commit is contained in:
rob bygrave
2018-05-14 21:32:48 +12:00
parent 95737cd3c5
commit 9dc5ca602c
2 changed files with 5 additions and 1 deletions
@@ -310,6 +310,10 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
String discProperty = prefix + "." + discriminatorColumn;
selectChain.add(discProperty);
}
if (targetIdBinder == null) {
throw new IllegalStateException("No Id binding property for " + getFullBeanName()
+ ". Probably a missing @OneToOne mapping annotation on this relationship?");
}
targetIdBinder.buildRawSqlSelectChain(prefix, selectChain);
} else {