Skip to content

Commit a556416

Browse files
committed
Added query fetches search for join existence.
Closes spring-projects#2253 See spring-projects/spring-data-build#2253
1 parent d0c3b1a commit a556416

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java

+10
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,16 @@ private static <T> T getAnnotationProperty(Attribute<?, ?> attribute, String pro
775775
return join;
776776
}
777777
}
778+
779+
for (Fetch<?, ?> fetch : from.getFetches()) {
780+
781+
Join<?, ?> join = (Join<?, ?>) fetch;
782+
if (joinType == join.getJoinType()
783+
&& join.getAttribute().getName().equals(attribute)) {
784+
return join;
785+
}
786+
}
787+
778788
return from.join(attribute, joinType);
779789
}
780790

0 commit comments

Comments
 (0)