| This issue was first reported on StackOverflow and I could also replicate it in my GitHub repository. Basically, we have an entity like this:
@Entity(name = "LocalDateEvent")
public class LocalDateEvent {
@Id
private Long id;
@NotNull
@Column(name = "START_DATE", nullable = false)
private LocalDate startDate;
}
and runt his test:
doInJPA(entityManager -> {
LocalDateEvent event = new LocalDateEvent();
event.id = 1L;
event.startDate = LocalDate.of(1, 1, 1);
entityManager.persist(event);
});
doInJPA(entityManager -> {
LocalDateEvent event = entityManager.find(LocalDateEvent.class, 1L);
assertEquals(LocalDate.of(1, 1, 1), event.startDate);
});
The assert throws: java.lang.AssertionError: expected:<0001-01-01> but was:<0000-12-29> So the object doesn't have the same value that was used prior to being persisted. Test case will be attached after I know the Jira number of this issue. |