Davide D'Alto (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZjRlN2E1OTNj...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16377?atlOrigin=eyJpIjoiZjRlN2...
) HHH-16377 (
https://hibernate.atlassian.net/browse/HHH-16377?atlOrigin=eyJpIjoiZjRlN2...
) LocalTime not saved correctly in MSSQL (
https://hibernate.atlassian.net/browse/HHH-16377?atlOrigin=eyJpIjoiZjRlN2...
)
Issue Type: Bug Assignee: Unassigned Created: 27/Mar/2023 03:05 AM Priority: Major
Reporter: Davide D'Alto (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
Here’s the simple test case for an entity Flour:
@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 );
}
}
@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;
}
...
}
The error:
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.
I’m using the following image:
podman run --rm -it --name HibernateTestingMSSQL -e 'ACCEPT_EULA=Y' -e
'SA_PASSWORD=~!HReact!~' -p 1433:1433
mcr.microsoft.com/mssql/server:2022-latest
(
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 )