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

This commit is contained in:
Robin Bygrave committed 2016-05-18 12:34:16 +12:00
1 parent 362ceea79b
commit 75a2633590
4 files changed
+33 -12

No files matched your search

@@ -1,18 +1,17 @@
package com.avaje.ebeaninternal.server.query;
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
import com.avaje.ebeaninternal.server.el.ElPropertyDeploy;
import javax.persistence.PersistenceException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
import com.avaje.ebeaninternal.server.el.ElPropertyDeploy;
/**
* Special Map of the logical property joins to table alias.
*
* @author rbygrave
*/
public class SqlTreeAlias {
@@ -61,7 +60,10 @@ public class SqlTreeAlias {
if (propJoins != null) {
for (String propJoin : propJoins) {
ElPropertyDeploy elProp = desc.getElPropertyDeploy(propJoin);
if (elProp != null && elProp.getBeanProperty().isEmbedded()) {
if (elProp == null) {
throw new PersistenceException("Invalid path " + propJoin + " from " + desc.getFullName());
} else if (elProp.getBeanProperty().isEmbedded()) {
addEmbeddedPropertyJoin(propJoin);
} else {