Richard Turner (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5bed604...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZDQ0OWFjODVh...
) / Improvement (
https://hibernate.atlassian.net/browse/HHH-16351?atlOrigin=eyJpIjoiZDQ0OW...
) HHH-16351 (
https://hibernate.atlassian.net/browse/HHH-16351?atlOrigin=eyJpIjoiZDQ0OW...
) Migrating from 5.6 to 6.1 to_timestamp(double) function now throws QueryException (
https://hibernate.atlassian.net/browse/HHH-16351?atlOrigin=eyJpIjoiZDQ0OW...
)
Issue Type: Improvement Affects Versions: 6.1.7 Assignee: Unassigned Components: query-hql
Created: 22/Mar/2023 03:56 AM Environment: hubernate 6.1, java 17, postgresql 14 Priority:
Major Reporter: Richard Turner (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5bed604...
)
Upgrading to Hibernate 6.1 from 5.6 now throws a QueryException where it used to work OK;
the exception states:
function to_timestamp() has type STRING, but argument is of type java.lang.Double
For the following query:
entityManager.createQuery(
"select r from Realm r where r.notBefore is null or r.notBefore = 0 or
to_timestamp(r.notBefore) <= now()" , Realm.class
).getResultList();
Seems that hibernate no longer recognises the alternative to_timestamp(double)
The dialect is being autodetected as org.hibernate.dialect.PostgreSQLDialect ; I don’t
know the internals of Hibernate to understand where this validation check is performed (I
cannot see any mention of to_timestamp in the dialect code.
Is this breaking change expected? I couldn’t see anything in the release notes related to
this but appreciate a lot has changed in 6.x.
I can work around the problem but would like to understand what has changed and also feel
this should be documented if not already.
(
https://hibernate.atlassian.net/browse/HHH-16351#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16351#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100219- sha1:eb3f1fe )