Skip to content

Commit

Permalink
Added query fetches search for join existence.
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonMolganov committed Feb 8, 2022
1 parent d0c3b1a commit a556416
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,16 @@ private static <T> T getAnnotationProperty(Attribute<?, ?> attribute, String pro
return join;
}
}

for (Fetch<?, ?> fetch : from.getFetches()) {

Join<?, ?> join = (Join<?, ?>) fetch;
if (joinType == join.getJoinType()
&& join.getAttribute().getName().equals(attribute)) {
return join;
}
}

return from.join(attribute, joinType);
}

Expand Down

0 comments on commit a556416

Please sign in to comment.