Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to execute a query with literal question mark in it #836

Open
jaroslawr opened this issue Jun 18, 2020 · 1 comment
Open

No way to execute a query with literal question mark in it #836

jaroslawr opened this issue Jun 18, 2020 · 1 comment

Comments

@jaroslawr
Copy link

? is intepreted by JPQL to bind parameters, but PostgreSQL has operators for JSONB that use a literal question mark (?, ?|, ?&) and there does not seem to be an obvious documented way to pass through a '?' so that EclipseLink does not try to interpret it and passes it through to the database, in particular with native queries and with the sql() function. Documentation in both cases does not mention any way of escaping the question mark to prevent it from being interpreted by eclipselink:

https://www.eclipse.org/eclipselink/documentation/2.4/concepts/queries005.htm
https://www.eclipse.org/eclipselink/documentation/2.4/jpa/extensions/j_sql.htm

@pvarga88
Copy link
Contributor

I have also run into this. I have raised PR #1935 as a suggested fix to use ?? as an escape mechanism, similar to how two single quotes ('') are used to escape a single quote (')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants