Quantcast
Channel: Vlad Mihalcea
Viewing all articles
Browse latest Browse all 177

How to map the OffsetDateTime ZoneOffset with Hibernate TimeZoneColumn

$
0
0

Introduction In this article, we are going to see how we can map the OffsetDateTime ZoneOffset with the Hibernate TimeZoneColumn annotation. As I explained in this article, by default, Hibernate doesn’t store the time-zone offset of an OffsetDateTime entity attribute in a separate column. Instead, Hibernate is going to store the associated java.time.Instant in the UTC time-zone offset. However, there are use cases when we need to save the associated ZoneOffset, and that’s exactly when you would use the TimeZoneColumn annotation. Domain Mode Let’s assume we have the following post table: Because... Read More

The post How to map the OffsetDateTime ZoneOffset with Hibernate TimeZoneColumn appeared first on Vlad Mihalcea.


Viewing all articles
Browse latest Browse all 177

Trending Articles