Davide D'Alto (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNjQ5OTRlMGY1...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16377?atlOrigin=eyJpIjoiNjQ5OT...
) HHH-16377 (
https://hibernate.atlassian.net/browse/HHH-16377?atlOrigin=eyJpIjoiNjQ5OT...
) LocalTime not saved correctly in MSSQL (
https://hibernate.atlassian.net/browse/HHH-16377?atlOrigin=eyJpIjoiNjQ5OT...
)
Change By: Davide D'Alto (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
Here’s the simple test case for an entity Flour:
{code:java} @Test
public void test() {
final Flour rose = new Flour( 2, "Rose", "made from ground rose
pedals.", "Full fragrance" );
rose.setLocalTime( LocalTime.MAX );
try (Session ormSession = ormFactory.openSession()) {
ormSession.beginTransaction();
ormSession.persist( rose );
ormSession.getTransaction().commit();
}
try (Session ormSession = ormFactory.openSession()) {
Flour flour = ormSession.find( Flour.class, rose.id );
Assertions.assertThat( rose.localTime ).isEqualToIgnoringSeconds( flour.localTime );
}
}
{code}
{code:java} @Entity(name = "Flour")
@Table(name = "Flour")
public static class Flour {
@Id
private Integer id;
private String name;
private String description;
private String type;
private LocalTime localTime;
public Flour() {
}
public Flour(Integer id, String name, String description, String type) {
this.id = id;
this.name = name;
this.description = description;
this.type = type;
}
...
}{code}
The error:
{noformat}Expecting actual:
23:59:59.999999999
to have same hour and minute as:
13:46:39
but had not.
java.lang.AssertionError:
Expecting actual:
23:59:59.999999999
to have same hour and minute as:
13:46:39
but had not.
{noformat}
I’m using the following image:
{noformat}podman run --rm -it --name HibernateTestingMSSQL -e 'ACCEPT_EULA=Y' -e
'SA_PASSWORD=~!HReact!~' -p 1433:1433
mcr.microsoft.com/mssql/server:2022-latest{noformat}
Note that it works with ORM 5.6.14.Final
(
https://hibernate.atlassian.net/browse/HHH-16377#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16377#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:ac3e918 )