Skip to content

Commit 0b38034

Browse files
committed
Handle VALUE function properly in JPQL queries.
See #3028
1 parent 782ac7b commit 0b38034

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

spring-data-jpa/src/main/antlr4/org/springframework/data/jpa/repository/query/Jpql.g4

+2-1
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,8 @@ identification_variable
603603
| ORDER
604604
| OUTER
605605
| FLOOR
606-
| SIGN)
606+
| SIGN
607+
| VALUE)
607608
;
608609

609610
constructor_name

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/HqlQueryRendererTests.java

+5
Original file line numberDiff line numberDiff line change
@@ -1522,6 +1522,11 @@ void queryWithSignShouldWork() {
15221522
assertQuery("select t.sign from TestEntity t");
15231523
}
15241524

1525+
@Test // GH-3028
1526+
void queryWithValueShouldWork() {
1527+
assertQuery("select t.value from TestEntity t");
1528+
}
1529+
15251530
@Test // GH-3024
15261531
void castFunctionWithFqdnShouldWork() {
15271532
assertQuery("SELECT o FROM Order o WHERE CAST(:userId AS java.util.UUID) IS NULL OR o.user.id = :userId");

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/JpqlQueryRendererTests.java

+5
Original file line numberDiff line numberDiff line change
@@ -936,4 +936,9 @@ void floorShouldBeValidEntityName() {
936936
void queryWithSignShouldWork() {
937937
assertQuery("select t.sign from TestEntity t");
938938
}
939+
940+
@Test // GH-3028
941+
void queryWithValueShouldWork() {
942+
assertQuery("select t.value from TestEntity t");
943+
}
939944
}

0 commit comments

Comments
 (0)