File tree 2 files changed +15
-7
lines changed
main/antlr4/org/springframework/data/jpa/repository/query
test/java/org/springframework/data/jpa/repository/query
2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ update_clause
164
164
;
165
165
166
166
update_item
167
- : (identification_variable ' .' )? (single_valued_embeddable_object_field ' .' )* (state_field | single_valued_object_field) ' = ' new_value
167
+ : (identification_variable ' .' )? (single_valued_embeddable_object_field ' .' )* (state_field | single_valued_object_field) EQUAL new_value
168
168
;
169
169
170
170
new_value
@@ -377,21 +377,21 @@ all_or_any_expression
377
377
378
378
comparison_expression
379
379
: string_expression comparison_operator (string_expression | all_or_any_expression)
380
- | boolean_expression op=(' = ' | ' <> ' ) (boolean_expression | all_or_any_expression)
381
- | enum_expression op=(' = ' | ' <> ' ) (enum_expression | all_or_any_expression)
380
+ | boolean_expression op=(EQUAL | NOT_EQUAL ) (boolean_expression | all_or_any_expression)
381
+ | enum_expression op=(EQUAL | NOT_EQUAL ) (enum_expression | all_or_any_expression)
382
382
| datetime_expression comparison_operator (datetime_expression | all_or_any_expression)
383
- | entity_expression op=(' = ' | ' <> ' ) (entity_expression | all_or_any_expression)
383
+ | entity_expression op=(EQUAL | NOT_EQUAL ) (entity_expression | all_or_any_expression)
384
384
| arithmetic_expression comparison_operator (arithmetic_expression | all_or_any_expression)
385
- | entity_type_expression op=(' = ' | ' <> ' ) entity_type_expression
385
+ | entity_type_expression op=(EQUAL | NOT_EQUAL ) entity_type_expression
386
386
;
387
387
388
388
comparison_operator
389
- : op=' = '
389
+ : op=EQUAL
390
390
| op=' >'
391
391
| op=' >='
392
392
| op=' <'
393
393
| op=' <='
394
- | op=' <> '
394
+ | op=NOT_EQUAL
395
395
;
396
396
397
397
arithmetic_expression
@@ -841,6 +841,9 @@ VALUE : V A L U E;
841
841
WHEN : W H E N ;
842
842
WHERE : W H E R E ;
843
843
844
+ EQUAL : ' =' ;
845
+ NOT_EQUAL : ' <>' | ' !=' ;
846
+
844
847
845
848
CHARACTER : ' \' ' (~ (' \' ' | ' \\ ' )) ' \' ' ;
846
849
IDENTIFICATION_VARIABLE : (' a' .. ' z' | ' A' .. ' Z' | ' \u0080 ' .. ' \ufffe ' | ' $' | ' _' ) (' a' .. ' z' | ' A' .. ' Z' | ' \u0080 ' .. ' \ufffe ' | ' 0' .. ' 9' | ' $' | ' _' )* ;
Original file line number Diff line number Diff line change @@ -948,4 +948,9 @@ void typeShouldBeAValidParameter() {
948
948
assertQuery ("select e from Employee e where e.type = :_type" );
949
949
assertQuery ("select te from TestEntity te where te.type = :type" );
950
950
}
951
+
952
+ @ Test // GH-3061
953
+ void alternateNotEqualsOperatorShouldWork () {
954
+ assertQuery ("select e from Employee e where e.firstName != :name" );
955
+ }
951
956
}
You can’t perform that action at this time.
0 commit comments