Skip to content

Fix parsing of single-character string literals in JPQL and EQL collection member expressions.#4282

Open
jewoodev wants to merge 1 commit into
spring-projects:mainfrom
jewoodev:fix-gh-4278-single-character-member-literal
Open

Fix parsing of single-character string literals in JPQL and EQL collection member expressions.#4282
jewoodev wants to merge 1 commit into
spring-projects:mainfrom
jewoodev:fix-gh-4278-single-character-member-literal

Conversation

@jewoodev

Copy link
Copy Markdown
Contributor

JPQL and EQL currently tokenize a single-character quoted string such as 'c' as CHARACTER, while other quoted strings are tokenized as STRINGLITERAL. The literal parser rule accepted STRINGLITERAL but not CHARACTER, causing a single-character string literal to fail when used as the left operand of MEMBER OF.

This change adds CHARACTER to the JPQL and EQL literal rules and covers the collection-member case with a shared query renderer round-trip test.

Jakarta Persistence allows a literal as the left operand of MEMBER OF, defines string literals as single-quoted strings without distinguishing single-character strings from longer strings, and itself uses 'Joe' MEMBER OF p.nicknames as an example.

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

Closes #4278

…ction member expressions.

Signed-off-by: jewoodev <jewoos15@naver.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JPQL and EQL fail to parse a single-character string literal as the left operand of MEMBER OF

2 participants