File tree Expand file tree Collapse 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 Expand file tree Collapse file tree 6 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -349,7 +349,7 @@ between_expression
349349 ;
350350
351351in_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)
353353 ;
354354
355355in_item
Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ between_expression
333333 ;
334334
335335in_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)
337337 ;
338338
339339in_item
Original file line number Diff line number Diff line change @@ -1228,8 +1228,8 @@ public List<JpaQueryParsingToken> visitIn_expression(EqlParser.In_expressionCont
12281228
12291229 List <JpaQueryParsingToken > tokens = new ArrayList <>();
12301230
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 ()));
12331233 }
12341234 if (ctx .type_discriminator () != null ) {
12351235 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
11491149
11501150 List <JpaQueryParsingToken > tokens = new ArrayList <>();
11511151
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 ()));
11541154 }
11551155 if (ctx .type_discriminator () != null ) {
11561156 tokens .addAll (visit (ctx .type_discriminator ()));
Original file line number Diff line number Diff line change 3737 *
3838 * @author Greg Turnquist
3939 * @author Christoph Strobl
40+ * @author Mark Paluch
4041 */
4142class EqlQueryRendererTests {
4243
@@ -1032,12 +1033,14 @@ void lateralShouldBeAValidParameter() {
10321033 assertQuery ("select te from TestEntity te where te.lateral = :lateral" );
10331034 }
10341035
1035- @ Test
1036+ @ Test // GH-3834
10361037 void reservedWordsShouldWork () {
10371038
10381039 assertQuery ("select ie from ItemExample ie left join ie.object io where io.externalId = :externalId" );
10391040 assertQuery ("select ie.object from ItemExample ie left join ie.object io where io.externalId = :externalId" );
10401041 assertQuery ("select ie from ItemExample ie left join ie.object io where io.object = :externalId" );
10411042 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" );
10421045 }
10431046}
Original file line number Diff line number Diff line change 3737 *
3838 * @author Greg Turnquist
3939 * @author Christoph Strobl
40+ * @author Mark Paluch
4041 * @since 3.1
4142 */
4243class JpqlQueryRendererTests {
@@ -1033,7 +1034,7 @@ void entityNameWithPackageContainingReservedWord(String reservedWord) {
10331034 assertQuery (source );
10341035 }
10351036
1036- @ Test
1037+ @ Test // GH-3834
10371038 void reservedWordsShouldWork () {
10381039
10391040 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