From 59be9a2890fb6a60c4c2071788672bc6af9838e5 Mon Sep 17 00:00:00 2001 From: vladislav kisel Date: Mon, 16 Dec 2024 10:45:58 +0100 Subject: [PATCH] Fix spring repo count query with join graphs --- .../encircled/joiner/spring/SpringJoinerKtRepositoryBaseImpl.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/joiner-spring/src/main/kotlin/cz/encircled/joiner/spring/SpringJoinerKtRepositoryBaseImpl.kt b/joiner-spring/src/main/kotlin/cz/encircled/joiner/spring/SpringJoinerKtRepositoryBaseImpl.kt index 9fdf4128..5466e6f6 100644 --- a/joiner-spring/src/main/kotlin/cz/encircled/joiner/spring/SpringJoinerKtRepositoryBaseImpl.kt +++ b/joiner-spring/src/main/kotlin/cz/encircled/joiner/spring/SpringJoinerKtRepositoryBaseImpl.kt @@ -76,6 +76,8 @@ class SpringJoinerKtRepositoryBaseImpl>(val joiner: JoinerK .filter { it.joinType == JoinType.LEFTJOIN } .forEach { countRequest.removeJoin(it) } + countRequest.joinGraphs.clear() + // Fetch is not allowed for count queries J.unrollChildrenJoins(countRequest.joins).forEach(Consumer { j: JoinDescription -> j.fetch(false) })