File tree 6 files changed +12
-8
lines changed
antlr4/org/springframework/data/jpa/repository/query
java/org/springframework/data/jpa/repository/query
test/java/org/springframework/data/jpa/repository/query
6 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -349,7 +349,7 @@ between_expression
349
349
;
350
350
351
351
in_expression
352
- : (state_valued_path_expression | type_discriminator) (NOT )? IN ((' (' in_item (' ,' in_item)* ' )' ) | ( ' (' subquery ' )' ) | collection_valued_input_parameter)
352
+ : (string_expression | type_discriminator) (NOT )? IN ((' (' in_item (' ,' in_item)* ' )' ) | ( ' (' subquery ' )' ) | collection_valued_input_parameter)
353
353
;
354
354
355
355
in_item
Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ between_expression
333
333
;
334
334
335
335
in_expression
336
- : (state_valued_path_expression | type_discriminator) (NOT )? IN ((' (' in_item (' ,' in_item)* ' )' ) | ( ' (' subquery ' )' ) | collection_valued_input_parameter)
336
+ : (string_expression | type_discriminator) (NOT )? IN ((' (' in_item (' ,' in_item)* ' )' ) | ( ' (' subquery ' )' ) | collection_valued_input_parameter)
337
337
;
338
338
339
339
in_item
Original file line number Diff line number Diff line change @@ -1228,8 +1228,8 @@ public List<JpaQueryParsingToken> visitIn_expression(EqlParser.In_expressionCont
1228
1228
1229
1229
List <JpaQueryParsingToken > tokens = new ArrayList <>();
1230
1230
1231
- if (ctx .state_valued_path_expression () != null ) {
1232
- tokens .addAll (visit (ctx .state_valued_path_expression ()));
1231
+ if (ctx .string_expression () != null ) {
1232
+ tokens .addAll (visit (ctx .string_expression ()));
1233
1233
}
1234
1234
if (ctx .type_discriminator () != null ) {
1235
1235
tokens .addAll (visit (ctx .type_discriminator ()));
Original file line number Diff line number Diff line change @@ -1149,8 +1149,8 @@ public List<JpaQueryParsingToken> visitIn_expression(JpqlParser.In_expressionCon
1149
1149
1150
1150
List <JpaQueryParsingToken > tokens = new ArrayList <>();
1151
1151
1152
- if (ctx .state_valued_path_expression () != null ) {
1153
- tokens .addAll (visit (ctx .state_valued_path_expression ()));
1152
+ if (ctx .string_expression () != null ) {
1153
+ tokens .addAll (visit (ctx .string_expression ()));
1154
1154
}
1155
1155
if (ctx .type_discriminator () != null ) {
1156
1156
tokens .addAll (visit (ctx .type_discriminator ()));
Original file line number Diff line number Diff line change 37
37
*
38
38
* @author Greg Turnquist
39
39
* @author Christoph Strobl
40
+ * @author Mark Paluch
40
41
*/
41
42
class EqlQueryRendererTests {
42
43
@@ -1032,12 +1033,14 @@ void lateralShouldBeAValidParameter() {
1032
1033
assertQuery ("select te from TestEntity te where te.lateral = :lateral" );
1033
1034
}
1034
1035
1035
- @ Test
1036
+ @ Test // GH-3834
1036
1037
void reservedWordsShouldWork () {
1037
1038
1038
1039
assertQuery ("select ie from ItemExample ie left join ie.object io where io.externalId = :externalId" );
1039
1040
assertQuery ("select ie.object from ItemExample ie left join ie.object io where io.externalId = :externalId" );
1040
1041
assertQuery ("select ie from ItemExample ie left join ie.object io where io.object = :externalId" );
1041
1042
assertQuery ("select ie from ItemExample ie where ie.status = com.app.domain.object.Status.UP" );
1043
+ assertQuery ("select f from FooEntity f where upper(f.name) IN :names" );
1044
+ assertQuery ("select f from FooEntity f where f.size IN :sizes" );
1042
1045
}
1043
1046
}
Original file line number Diff line number Diff line change 37
37
*
38
38
* @author Greg Turnquist
39
39
* @author Christoph Strobl
40
+ * @author Mark Paluch
40
41
* @since 3.1
41
42
*/
42
43
class JpqlQueryRendererTests {
@@ -1033,7 +1034,7 @@ void entityNameWithPackageContainingReservedWord(String reservedWord) {
1033
1034
assertQuery (source );
1034
1035
}
1035
1036
1036
- @ Test
1037
+ @ Test // GH-3834
1037
1038
void reservedWordsShouldWork () {
1038
1039
1039
1040
assertQuery ("select ie from ItemExample ie left join ie.object io where io.externalId = :externalId" );
You can’t perform that action at this time.
0 commit comments