[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[eclipselink-users] JPQL order by COALESCE() sometimes generates invalid query
|
Hi.
I have a JPQ-query:
SELECT e FROM CalendarEntry e JOIN e.activity.project proj
WHERE proj.id = :projectId
ORDER BY COALESCE(e.changeInfo.modified, e.changeInfo.created) DESC
with .setMaxResults(1)
Sometimes I get an error:
Internal Exception: java.sql.SQLException: Parameter index out of bounds
bind => [3 parameters bound]
And the query never hits the DB and EL prints out this query (showing the last part of it), which in syntactically invalid (having comma instead of parenthese after "t5.created"):
ORDER BY COALESCE(t5.modified,t5.created, DESC LIMIT
Where it should generate:
ORDER BY COALESCE(t5.modified,t5.created) DESC LIMIT
This happens occationally.
Any hints?
Thanks.
--
Andreas Joseph Krogh <andreak@xxxxxxxxxxxx> mob: +47 909 56 963
Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no
Public key: http://home.officenet.no/~andreak/public_key.asc