Skip to content

Commit 34e2331

Browse files
committed
FROM and DATE should be usable as parameters in JPQL queries.
See #3092
1 parent a096ce2 commit 34e2331

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,8 @@ trim_character
597597
identification_variable
598598
: IDENTIFICATION_VARIABLE
599599
| f=(COUNT
600+
| DATE
601+
| FROM
600602
| INNER
601603
| KEY
602604
| LEFT

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

+5
Original file line numberDiff line numberDiff line change
@@ -953,4 +953,9 @@ void typeShouldBeAValidParameter() {
953953
void alternateNotEqualsOperatorShouldWork() {
954954
assertQuery("select e from Employee e where e.firstName != :name");
955955
}
956+
957+
@Test // GH-3092
958+
void dateAndFromShouldBeValidNames() {
959+
assertQuery("SELECT e FROM Entity e WHERE e.embeddedId.date BETWEEN :from AND :to");
960+
}
956961
}

0 commit comments

Comments
 (0)