Christophe GILLES (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=712020%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZGVkNDVhYTcy...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16764?atlOrigin=eyJpIjoiZGVkND...
) HHH-16764 (
https://hibernate.atlassian.net/browse/HHH-16764?atlOrigin=eyJpIjoiZGVkND...
) Version annotation is not working with OffsetDatetime (
https://hibernate.atlassian.net/browse/HHH-16764?atlOrigin=eyJpIjoiZGVkND...
)
Issue Type: Bug Affects Versions: 6.2.3, 6.2.4 Assignee: Unassigned Components:
hibernate-core Created: 07/Jun/2023 03:12 AM Priority: Major Reporter: Christophe GILLES (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=712020%...
)
Since Hibernate 6, Version annotation does not work well with OffsetDatetime on postgresql
due to the control
if ( !entry.getVersion().equals( latestVersion ) )
made in *EntityVerifyVersionProcess*
Method “equals” on OffsetDatetime checks if Offset *and* Datetime are equals.
OffsetDateTime exposes 2 methods:
* equals : checks the strict equality (localdatetime AND offset)
* isEquals: checks that both date are semantically the same (ie: same instant)
IMHO *EntityVerifyVersionProcess* should use isEquals to compare equality between 2
OffsetDateTime. In our case, the problem arises because our postgresql server is using UTC
while our java application is deployed on a server with another timezone.
(
https://hibernate.atlassian.net/browse/HHH-16764#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16764#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#100225- sha1:62413c2 )