Hi.
I have this native-query (I use Scala-JPA, which is a thin
wrapper):
entityManager.createNativeQuery[Boolean](
"""SELECT s.is_seen
FROM origo_email_message_property s
WHERE s.owner_id = :ownerId AND s.message_id = :messageId""").
setParams("ownerId" -> owner.id, "messageId" -> messageId)
Which results in this SQLException using PostgreSQL:
Internal Exception: java.sql.SQLException: syntax error
at or near ":"
Error Code: 0
Call: SELECT s.is_seen
FROM
origo_email_message_property s
WHERE s.owner_id = :ownerId AND
s.message_id = :messageId
It seems EL sends the query unmodified to PG and PG doesn't
support :<param_name> syntax, only indexed (as in "where
id = ?"). Hibernate handles this quite nicely and rewrites the
query if necessary it seems.
Is this a known issue using PG and one has to use indexed
instead of named params in native-queries?
Thanks.
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users