From fe8b64d4561d7077cc871f930359a9d6a672c9a4 Mon Sep 17 00:00:00 2001 From: sikron Date: Mon, 31 Oct 2016 22:26:49 +0100 Subject: [PATCH] changed the join procedure to do a fetching --- .gitignore | 2 ++ .../java/com/github/tennaito/rsql/jpa/PredicateBuilder.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) 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});