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
705705
706706collection_valued_field
707707 : identification_variable
708+ | reserved_word
708709 ;
709710
710711single_valued_object_field
711712 : identification_variable
713+ | reserved_word
712714 ;
713715
714716state_field
715717 : identification_variable
718+ | reserved_word
716719 ;
717720
718721collection_value_field
719722 : identification_variable
723+ | reserved_word
720724 ;
721725
722726entity_name
Original file line number Diff line number Diff line change @@ -2469,21 +2469,37 @@ public List<JpaQueryParsingToken> visitSubtype(EqlParser.SubtypeContext ctx) {
24692469
24702470 @ Override
24712471 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+ }
24722476 return visit (ctx .identification_variable ());
24732477 }
24742478
24752479 @ Override
24762480 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+ }
24772485 return visit (ctx .identification_variable ());
24782486 }
24792487
24802488 @ Override
24812489 public List <JpaQueryParsingToken > visitState_field (EqlParser .State_fieldContext ctx ) {
2490+
2491+ if (ctx .reserved_word () != null ) {
2492+ return visit (ctx .reserved_word ());
2493+ }
24822494 return visit (ctx .identification_variable ());
24832495 }
24842496
24852497 @ Override
24862498 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+ }
24872503 return visit (ctx .identification_variable ());
24882504 }
24892505
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ void selectClause() {
7878
7979 assertQuery ("SELECT COUNT(e) FROM Employee e" );
8080 assertQuery ("SELECT MAX(e.salary) FROM Employee e" );
81+ assertQuery ("select sum(i.size.foo.bar.new) from Item i" );
8182 assertQuery ("SELECT NEW com.acme.reports.EmpReport(e.firstName, e.lastName, e.salary) FROM Employee e" );
8283 }
8384
@@ -348,8 +349,11 @@ void specialOperators() {
348349 assertQuery ("SELECT toDo FROM Employee e JOIN e.toDoList toDo WHERE INDEX(toDo) = 1" );
349350 assertQuery ("SELECT p FROM Employee e JOIN e.priorities p WHERE KEY(p) = 'high'" );
350351 assertQuery ("SELECT e FROM Employee e WHERE SIZE(e.managedEmployees) < 2" );
352+ assertQuery ("SELECT e FROM Employee e WHERE SIZE(e.managedEmployees.new) < 2" );
351353 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" );
352355 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" );
353357 assertQuery ("SELECT p FROM Project p WHERE TYPE(p) = LargeProject" );
354358
355359 /**
You can’t perform that action at this time.
0 commit comments