#710 - Behavior change - query with invalid fetch path (without properties) now throws PersistenceException

This commit is contained in:
Robin Bygrave
2016-05-18 12:34:16 +12:00
parent 362ceea79b
commit 75a2633590
4 changed files with 33 additions and 12 deletions
@@ -353,7 +353,10 @@ public class OrmQueryDetail implements Serializable {
for (String fetchPath : fetchPaths.keySet()) {
ElPropertyDeploy elProp = beanDescriptor.getElPropertyDeploy(fetchPath);
if (elProp != null && elProp.containsManySince(manyFetchProperty)) {
if (elProp == null) {
throw new PersistenceException("Invalid fetch path " + fetchPath + " from " + beanDescriptor.getFullName());
}
if (elProp.containsManySince(manyFetchProperty)) {
// this is a join to a *ToMany
OrmQueryProperties chunk = fetchPaths.get(fetchPath);