Could you please post a short example of how to use COALESCE
and IS NULL
with scalar parameters?
Use e.g. …(cast(:fromTime as timestamp) is null OR al.createdAt >= :fromTime) …
. It should IMO also work without the cast, but probably won’t because of a bug.
Please try to create a reproducer with our test case template and if you are able to reproduce the issue, create a bug ticket in our issue tracker and attach that reproducer.
Thanks for your answer.
The cast
option is what I mentioned in the first post, asking whether it is proper workaround, so I’ll go either with cast
or with introducing logical parameter that represents whether some value is null/empty or not (same workaround as for the lists).
As already mentioned in this post:
…(:fromTime IS NULL OR al.createdAt >= :fromTime)
…
without cast
, it has never been working (tried with hibernate v5 and v6), saying:
ERROR: could not determine data type of parameter $9