File tree Expand file tree Collapse 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 Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ update_clause
164164 ;
165165
166166update_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
168168 ;
169169
170170new_value
@@ -377,21 +377,21 @@ all_or_any_expression
377377
378378comparison_expression
379379 : 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)
382382 | 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)
384384 | 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
386386 ;
387387
388388comparison_operator
389- : op=' = '
389+ : op=EQUAL
390390 | op=' >'
391391 | op=' >='
392392 | op=' <'
393393 | op=' <='
394- | op=' <> '
394+ | op=NOT_EQUAL
395395 ;
396396
397397arithmetic_expression
@@ -841,6 +841,9 @@ VALUE : V A L U E;
841841WHEN : W H E N ;
842842WHERE : W H E R E ;
843843
844+ EQUAL : ' =' ;
845+ NOT_EQUAL : ' <>' | ' !=' ;
846+
844847
845848CHARACTER : ' \' ' (~ (' \' ' | ' \\ ' )) ' \' ' ;
846849IDENTIFICATION_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() {
948948 assertQuery ("select e from Employee e where e.type = :_type" );
949949 assertQuery ("select te from TestEntity te where te.type = :type" );
950950 }
951+
952+ @ Test // GH-3061
953+ void alternateNotEqualsOperatorShouldWork () {
954+ assertQuery ("select e from Employee e where e.firstName != :name" );
955+ }
951956}
You can’t perform that action at this time.
0 commit comments