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 @@ -337,7 +337,7 @@ between_expression
337
337
;
338
338
339
339
in_expression
340
- : (state_valued_path_expression | type_discriminator) (NOT )? IN ((' (' in_item (' ,' in_item)* ' )' ) | ( ' (' subquery ' )' ) | collection_valued_input_parameter)
340
+ : (string_expression | type_discriminator) (NOT )? IN ((' (' in_item (' ,' in_item)* ' )' ) | ( ' (' subquery ' )' ) | collection_valued_input_parameter)
341
341
;
342
342
343
343
in_item
Original file line number Diff line number Diff line change @@ -1155,8 +1155,8 @@ public QueryTokenStream visitIn_expression(EqlParser.In_expressionContext ctx) {
1155
1155
1156
1156
QueryRendererBuilder builder = QueryRenderer .builder ();
1157
1157
1158
- if (ctx .state_valued_path_expression () != null ) {
1159
- builder .append (visit (ctx .state_valued_path_expression ()));
1158
+ if (ctx .string_expression () != null ) {
1159
+ builder .append (visit (ctx .string_expression ()));
1160
1160
}
1161
1161
if (ctx .type_discriminator () != null ) {
1162
1162
builder .append (visit (ctx .type_discriminator ()));
Original file line number Diff line number Diff line change @@ -1078,8 +1078,8 @@ public QueryTokenStream visitIn_expression(JpqlParser.In_expressionContext ctx)
1078
1078
1079
1079
QueryRendererBuilder builder = QueryRenderer .builder ();
1080
1080
1081
- if (ctx .state_valued_path_expression () != null ) {
1082
- builder .appendExpression (visit (ctx .state_valued_path_expression ()));
1081
+ if (ctx .string_expression () != null ) {
1082
+ builder .appendExpression (visit (ctx .string_expression ()));
1083
1083
}
1084
1084
if (ctx .type_discriminator () != null ) {
1085
1085
builder .appendExpression (visit (ctx .type_discriminator ()));
Original file line number Diff line number Diff line change 36
36
*
37
37
* @author Greg Turnquist
38
38
* @author Christoph Strobl
39
+ * @author Mark Paluch
39
40
*/
40
41
class EqlQueryRendererTests {
41
42
@@ -1041,12 +1042,14 @@ void lateralShouldBeAValidParameter() {
1041
1042
assertQuery ("select te from TestEntity te where te.lateral = :lateral" );
1042
1043
}
1043
1044
1044
- @ Test
1045
+ @ Test // GH-3834
1045
1046
void reservedWordsShouldWork () {
1046
1047
1047
1048
assertQuery ("select ie from ItemExample ie left join ie.object io where io.externalId = :externalId" );
1048
1049
assertQuery ("select ie.object from ItemExample ie left join ie.object io where io.externalId = :externalId" );
1049
1050
assertQuery ("select ie from ItemExample ie left join ie.object io where io.object = :externalId" );
1050
1051
assertQuery ("select ie from ItemExample ie where ie.status = com.app.domain.object.Status.UP" );
1052
+ assertQuery ("select f from FooEntity f where upper(f.name) IN :names" );
1053
+ assertQuery ("select f from FooEntity f where f.size IN :sizes" );
1051
1054
}
1052
1055
}
Original file line number Diff line number Diff line change 36
36
*
37
37
* @author Greg Turnquist
38
38
* @author Christoph Strobl
39
+ * @author Mark Paluch
39
40
* @since 3.1
40
41
*/
41
42
class JpqlQueryRendererTests {
@@ -1027,7 +1028,7 @@ void entityNameWithPackageContainingReservedWord(String reservedWord) {
1027
1028
assertQuery (source );
1028
1029
}
1029
1030
1030
- @ Test
1031
+ @ Test // GH-3834
1031
1032
void reservedWordsShouldWork () {
1032
1033
1033
1034
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