diff --git a/spring-data-jpa/src/main/antlr4/org/springframework/data/jpa/repository/query/Hql.g4 b/spring-data-jpa/src/main/antlr4/org/springframework/data/jpa/repository/query/Hql.g4 index 80af871fc6..8796cf1f82 100644 --- a/spring-data-jpa/src/main/antlr4/org/springframework/data/jpa/repository/query/Hql.g4 +++ b/spring-data-jpa/src/main/antlr4/org/springframework/data/jpa/repository/query/Hql.g4 @@ -977,7 +977,6 @@ RANGE : R A N G E; RESPECT : R E S P E C T; RIGHT : R I G H T; ROLLUP : R O L L U P; -ROUND : R O U N D; ROW : R O W; ROWS : R O W S; SEARCH : S E A R C H; diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/HqlQueryRendererTests.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/HqlQueryRendererTests.java index 672c65aba4..f6343f51bd 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/HqlQueryRendererTests.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/HqlQueryRendererTests.java @@ -1448,13 +1448,26 @@ void orderByWithNullsFirstOrLastShouldWork() { assertThatNoException().isThrownBy(() -> { parseWithoutChanges(""" - select a, - case - when a.geaendertAm is null then a.erstelltAm - else a.geaendertAm end as mutationAm - from Element a - where a.erstelltDurch = :variable - order by mutationAm desc nulls last + select a, + case + when a.geaendertAm is null then a.erstelltAm + else a.geaendertAm end as mutationAm + from Element a + where a.erstelltDurch = :variable + order by mutationAm desc nulls last + """); + }); + } + + @Test // GH-2964 + void roundFunctionShouldWorkLikeAnyOtherFunction() { + + assertThatNoException().isThrownBy(() -> { + parseWithoutChanges(""" + select round(count(ri) * 100 / max(ri.receipt.positions), 0) as perc + from StockOrderItem oi + right join StockReceiptItem ri + on ri.article = oi.article """); }); }