File tree 3 files changed +28
-0
lines changed
antlr4/org/springframework/data/jpa/repository/query
java/org/springframework/data/jpa/repository/query
test/java/org/springframework/data/jpa/repository/query
3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -705,18 +705,22 @@ subtype
705
705
706
706
collection_valued_field
707
707
: identification_variable
708
+ | reserved_word
708
709
;
709
710
710
711
single_valued_object_field
711
712
: identification_variable
713
+ | reserved_word
712
714
;
713
715
714
716
state_field
715
717
: identification_variable
718
+ | reserved_word
716
719
;
717
720
718
721
collection_value_field
719
722
: identification_variable
723
+ | reserved_word
720
724
;
721
725
722
726
entity_name
Original file line number Diff line number Diff line change @@ -2317,21 +2317,41 @@ public QueryTokenStream visitSubtype(EqlParser.SubtypeContext ctx) {
2317
2317
2318
2318
@ Override
2319
2319
public QueryTokenStream visitCollection_valued_field (EqlParser .Collection_valued_fieldContext ctx ) {
2320
+
2321
+ if (ctx .reserved_word () != null ) {
2322
+ return visit (ctx .reserved_word ());
2323
+ }
2324
+
2320
2325
return visit (ctx .identification_variable ());
2321
2326
}
2322
2327
2323
2328
@ Override
2324
2329
public QueryTokenStream visitSingle_valued_object_field (EqlParser .Single_valued_object_fieldContext ctx ) {
2330
+
2331
+ if (ctx .reserved_word () != null ) {
2332
+ return visit (ctx .reserved_word ());
2333
+ }
2334
+
2325
2335
return visit (ctx .identification_variable ());
2326
2336
}
2327
2337
2328
2338
@ Override
2329
2339
public QueryTokenStream visitState_field (EqlParser .State_fieldContext ctx ) {
2340
+
2341
+ if (ctx .reserved_word () != null ) {
2342
+ return visit (ctx .reserved_word ());
2343
+ }
2344
+
2330
2345
return visit (ctx .identification_variable ());
2331
2346
}
2332
2347
2333
2348
@ Override
2334
2349
public QueryTokenStream visitCollection_value_field (EqlParser .Collection_value_fieldContext ctx ) {
2350
+
2351
+ if (ctx .reserved_word () != null ) {
2352
+ return visit (ctx .reserved_word ());
2353
+ }
2354
+
2335
2355
return visit (ctx .identification_variable ());
2336
2356
}
2337
2357
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ void selectClause() {
72
72
73
73
assertQuery ("SELECT COUNT(e) FROM Employee e" );
74
74
assertQuery ("SELECT MAX(e.salary) FROM Employee e" );
75
+ assertQuery ("select sum(i.size.foo.bar.new) from Item i" );
75
76
assertQuery ("SELECT NEW com.acme.reports.EmpReport(e.firstName, e.lastName, e.salary) FROM Employee e" );
76
77
}
77
78
@@ -342,8 +343,11 @@ void specialOperators() {
342
343
assertQuery ("SELECT toDo FROM Employee e JOIN e.toDoList toDo WHERE INDEX(toDo) = 1" );
343
344
assertQuery ("SELECT p FROM Employee e JOIN e.priorities p WHERE KEY(p) = 'high'" );
344
345
assertQuery ("SELECT e FROM Employee e WHERE SIZE(e.managedEmployees) < 2" );
346
+ assertQuery ("SELECT e FROM Employee e WHERE SIZE(e.managedEmployees.new) < 2" );
345
347
assertQuery ("SELECT e FROM Employee e WHERE e.managedEmployees IS EMPTY" );
348
+ assertQuery ("SELECT e FROM Employee e WHERE e.managedEmployee.size.new IS EMPTY" );
346
349
assertQuery ("SELECT e FROM Employee e WHERE 'write code' MEMBER OF e.responsibilities" );
350
+ assertQuery ("SELECT e FROM Employee e WHERE 'write code' MEMBER OF e.responsibilities.size" );
347
351
assertQuery ("SELECT p FROM Project p WHERE TYPE(p) = LargeProject" );
348
352
349
353
/**
You can’t perform that action at this time.
0 commit comments