File tree Expand file tree Collapse file tree 3 files changed +24
-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 Expand file tree Collapse file tree 3 files changed +24
-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 @@ -2469,21 +2469,37 @@ public List<JpaQueryParsingToken> visitSubtype(EqlParser.SubtypeContext ctx) {
2469
2469
2470
2470
@ Override
2471
2471
public List <JpaQueryParsingToken > visitCollection_valued_field (EqlParser .Collection_valued_fieldContext ctx ) {
2472
+
2473
+ if (ctx .reserved_word () != null ) {
2474
+ return visit (ctx .reserved_word ());
2475
+ }
2472
2476
return visit (ctx .identification_variable ());
2473
2477
}
2474
2478
2475
2479
@ Override
2476
2480
public List <JpaQueryParsingToken > visitSingle_valued_object_field (EqlParser .Single_valued_object_fieldContext ctx ) {
2481
+
2482
+ if (ctx .reserved_word () != null ) {
2483
+ return visit (ctx .reserved_word ());
2484
+ }
2477
2485
return visit (ctx .identification_variable ());
2478
2486
}
2479
2487
2480
2488
@ Override
2481
2489
public List <JpaQueryParsingToken > visitState_field (EqlParser .State_fieldContext ctx ) {
2490
+
2491
+ if (ctx .reserved_word () != null ) {
2492
+ return visit (ctx .reserved_word ());
2493
+ }
2482
2494
return visit (ctx .identification_variable ());
2483
2495
}
2484
2496
2485
2497
@ Override
2486
2498
public List <JpaQueryParsingToken > visitCollection_value_field (EqlParser .Collection_value_fieldContext ctx ) {
2499
+
2500
+ if (ctx .reserved_word () != null ) {
2501
+ return visit (ctx .reserved_word ());
2502
+ }
2487
2503
return visit (ctx .identification_variable ());
2488
2504
}
2489
2505
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ void selectClause() {
78
78
79
79
assertQuery ("SELECT COUNT(e) FROM Employee e" );
80
80
assertQuery ("SELECT MAX(e.salary) FROM Employee e" );
81
+ assertQuery ("select sum(i.size.foo.bar.new) from Item i" );
81
82
assertQuery ("SELECT NEW com.acme.reports.EmpReport(e.firstName, e.lastName, e.salary) FROM Employee e" );
82
83
}
83
84
@@ -348,8 +349,11 @@ void specialOperators() {
348
349
assertQuery ("SELECT toDo FROM Employee e JOIN e.toDoList toDo WHERE INDEX(toDo) = 1" );
349
350
assertQuery ("SELECT p FROM Employee e JOIN e.priorities p WHERE KEY(p) = 'high'" );
350
351
assertQuery ("SELECT e FROM Employee e WHERE SIZE(e.managedEmployees) < 2" );
352
+ assertQuery ("SELECT e FROM Employee e WHERE SIZE(e.managedEmployees.new) < 2" );
351
353
assertQuery ("SELECT e FROM Employee e WHERE e.managedEmployees IS EMPTY" );
354
+ assertQuery ("SELECT e FROM Employee e WHERE e.managedEmployee.size.new IS EMPTY" );
352
355
assertQuery ("SELECT e FROM Employee e WHERE 'write code' MEMBER OF e.responsibilities" );
356
+ assertQuery ("SELECT e FROM Employee e WHERE 'write code' MEMBER OF e.responsibilities.size" );
353
357
assertQuery ("SELECT p FROM Project p WHERE TYPE(p) = LargeProject" );
354
358
355
359
/**
You can’t perform that action at this time.
0 commit comments