#1572 - Support query.select("customer.id").findSingleAttributeList() ... in addition to the expected and working select("customer").findSingleAttributeList()

This commit is contained in:
rob bygrave
2018-12-06 00:15:06 +13:00
parent e4088c5fbe
commit bafba0babf
2 changed files with 18 additions and 7 deletions
@@ -419,15 +419,11 @@ public final class SqlTreeBuilder {
} else {
logger.error("property [" + propName + "] not found on " + desc + " for query - excluding it.");
}
} else if (p.isEmbedded()) {
// add the embedded bean (and effectively
// all its properties)
} else if (p.isEmbedded() || (p instanceof STreePropertyAssoc && !queryProps.isIncludedBeanJoin(p.getName()))) {
// add the embedded bean or the *ToOne assoc bean. We skip the check that the *ToOne propName maps to Id property ...
selectProps.add(p);
} else {
String m = "property [" + p.getFullBeanName() + "] expected to be an embedded bean for query - excluding it.";
logger.error(m);
logger.error("property [" + p.getFullBeanName() + "] expected to be an embedded or *ToOne bean for query - excluding it.");
}
}