File tree Expand file tree Collapse file tree
main/antlr4/org/springframework/data/jpa/repository/query
test/java/org/springframework/data/jpa/repository/query Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/*
2- * Copyright 2023 the original author or authors.
2+ * Copyright 2023-present the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@ grammar Eql;
2323 * @see https://eclipse.dev/eclipselink/documentation/3.0/jpa/extensions/jpql.htm
2424 * @author Greg Turnquist
2525 * @author Christoph Strobl
26+ * @author Jewoo Shin
2627 * @since 3.2
2728 */
2829}
@@ -677,6 +678,7 @@ constructor_name
677678
678679literal
679680 : STRINGLITERAL
681+ | CHARACTER
680682 | JAVASTRINGLITERAL
681683 | INTLITERAL
682684 | FLOATLITERAL
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2011-2023 the original author or authors.
2+ * Copyright 2011-present the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ grammar Jpql;
2424 * @see https://github.com/jakartaee/persistence/blob/master/spec/src/main/asciidoc/ch04-query-language.adoc#bnf
2525 * @author Greg Turnquist
2626 * @author Christoph Strobl
27+ * @author Jewoo Shin
2728 * @since 3.1
2829 */
2930}
@@ -670,6 +671,7 @@ constructor_name
670671
671672literal
672673 : STRINGLITERAL
674+ | CHARACTER
673675 | JAVASTRINGLITERAL
674676 | INTLITERAL
675677 | FLOATLITERAL
Original file line number Diff line number Diff line change @@ -250,6 +250,22 @@ void specialOperators() {
250250 assertQuery ("SELECT p FROM Phone p WHERE FUNCTION('TO_NUMBER', p.areaCode) > 613" );
251251 }
252252
253+ @ Test // GH-4278
254+ void singleCharacterLiteralAsCollectionMemberExpression () {
255+
256+ assertQuery ("SELECT e FROM Employee e WHERE 'c' MEMBER OF e.responsibilities" );
257+ assertQuery ("SELECT e FROM Employee e WHERE 'c' NOT MEMBER OF e.responsibilities" );
258+
259+ assertQuery ("""
260+ SELECT e
261+ FROM Employee e
262+ WHERE EXISTS (SELECT p FROM Person p WHERE 'c' MEMBER OF p.nicknames)
263+ """ );
264+
265+ assertQuery ("UPDATE Employee e SET e.name = 'x' WHERE 'c' MEMBER OF e.responsibilities" );
266+ assertQuery ("DELETE FROM Employee e WHERE 'c' MEMBER OF e.responsibilities" );
267+ }
268+
253269 @ Test // GH-3314
254270 void isNullAndIsNotNull () {
255271
You can’t perform that action at this time.
0 commit comments