diff --git a/.gitignore b/.gitignore index 34eb2ec..27fb0ba 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ /.settings /.classpath /.project +/.idea/ +*.iml diff --git a/src/main/java/com/github/tennaito/rsql/jpa/PredicateBuilder.java b/src/main/java/com/github/tennaito/rsql/jpa/PredicateBuilder.java index 468e724..62f145b 100755 --- a/src/main/java/com/github/tennaito/rsql/jpa/PredicateBuilder.java +++ b/src/main/java/com/github/tennaito/rsql/jpa/PredicateBuilder.java @@ -216,7 +216,9 @@ public static Path findPropertyPath(String propertyPath, Path startRoot, if (root instanceof Join) { root = root.get(mappedProperty); } else { - root = ((From) root).join(mappedProperty); +// root = ((From) root).join(mappedProperty); + //http://stackoverflow.com/questions/4511368/jpa-2-criteria-fetch-path-navigation + root = (Join)((From) root).fetch(mappedProperty); } } else { LOG.log(Level.INFO, "Create property path for type {0} property {1}.", new Object[]{classMetadata.getJavaType().getName(), mappedProperty});