Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » JPQL SQL Function does not accept or escape single qoutes
JPQL SQL Function does not accept or escape single qoutes [message #1823308] Tue, 24 March 2020 17:03
Jeroen Benckhuijsen is currently offline Jeroen BenckhuijsenFriend
Messages: 1
Registered: March 2020
Junior Member
Hi,

I'm running into the following issue: we're using EclipseLink and want to use the SQL() function to use PostgreSQLs native JSONB support in querying. For example:

Native query: SELECT ID, AGGREGATE, SCHEMAVERSION FROM TestEntity WHERE AGGREGATE->>'someValue' ILIKE ?

I've tried various ways to desribe this in JPQL using the SQL function, however I'm running into the issue I need to specific "-->' someValue' " which contains single quotes. When using these, the parser fails to recognize the JPQL as valid, and it doesn't seem to allow me to escape the single qoutes, e.g.:

JPQL: SELECT e FROM TestEntity e WHERE SQL('?->>\'someValue\' ILIKE ?', e.aggregate, :parameter)

Any suggestions? I am aware of being able to use native queries, however I would like to avoid this, as we're also looking into using the multi-tenancy features.

Kind regards,

Jeroen
Previous Topic:How to use MOXy as default JAXB implementation?
Next Topic:Pdf link in Understanding EclipseLink Concepts 2.7 pointing to 2.6
Goto Forum:
  


Current Time: Fri Oct 04 20:42:16 GMT 2024

Powered by FUDForum. Page generated in 0.03224 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top