TimezoneStorageType – Hibernate’s improved timezone mapping
|

TimezoneStorageType – Hibernate’s improved timezone mapping

Working with timestamps with timezone information has always been a struggle. Since Java 8 introduced the Date and Time API, OffsetDateTime and ZonedDateTime have become the most obvious and commonly used types to model a timestamp with timezone information. And you might expect that choosing one of them should be the only thing you need…

How to persist additional attributes for an association with JPA and Hibernate
|

How to persist additional attributes for an association with JPA and Hibernate

JPA and Hibernate allow you to define associations between entities with just a few annotations, and you don’t have to care about the underlying table model in the database. Even join tables for many-to-many associations are hidden behind a @JoinTable annotation, and you don’t need to model the additional table as an entity. That changes…

8 things you need to know when migrating to Hibernate 6.x
|

8 things you need to know when migrating to Hibernate 6.x

Hibernate 6 has been released for a while, and the latest Spring Data JPA version includes it as a dependency. So, it’s no surprise that more and more developers want to migrate their applications to the latest Hibernate version. As you’re reading this article, you’re probably one of them. And you might ask yourself what…

How to map composite column types with Hibernate
|

How to map composite column types with Hibernate

When most developers design their table and entity models, they create tables that only use basic column types and map these to basic entity attributes. Even though these are the most commonly used types, they are not the only ones supported by modern relational databases and Hibernate. You can also use composite, JSON, and XML…