LocalTime attribute not saving the correct time (SOLVED)

Hi all,

I have a project where one of my entities has an attribute of type java.time.LocalTime. During my tests I notice that the time saved to my test database (H2) was incorrect. My date was fixed in my test, like this:

LocalTime.of(8, 10, 55);

However, every time a time was saved in the database, it was completely off.

I debugged the hibernate code and manage to find out that the problem is actually in the Jadira framework, more specifically in the class TimeColumnLocalTimeMapper:

https://github.com/JadiraOrg/jadira/blob/master/usertype.core/src/main/java/org/jadira/usertype/dateandtime/threeten/columnmapper/TimeColumnLocalTimeMapper.java, line 58.

There was even an issue logged there from someone with a similar problem.

The reason that I’m posting this here is to know if there’s any way to replace Jadira by another mapper or another way to use LocalTime as my column type, without relying on the Jadira framework.
It probably won’t be fixed soon. (I will try to create a pull request there).


I manage to solve it by annotating my parameter as:

@Type(type = "org.hibernate.type.LocalTimeType")

I wonder why isn’t that configured by default in hibernate?