PostgreSQL SERIAL or IDENTITY column and Hibernate IDENTITY generator
Introduction When using PostgreSQL, it’s tempting to use a SERIAL or BIGSERIAL column type to auto-increment Primary Keys. PostgreSQL 10 also added support for IDENTITY, which behaves in the same way as the legacy SERIAL or BIGSERIAL type. This article will show you that SERIAL, BIGSERIAL, and IDENTITY are not a very good idea when using JPA and Hibernate.
How to customize the Hypersistence Utils JSON Serializer
Introduction The Hypersistence Utils open-source project allows you to map JSON, ARRAY, and PostgreSQL ENUM types and provides a simple way of adding immutable Hibernate Types. After adding support for customizing the Jackson ObjectMapper, the next most-wanted issue was to provide a way to customize the JSON serializing mechanism. In this article, you are going to see how you can customize the JSON serializer used by the JSON Types.
How to use a JVM or database auto-generated UUID identifier with JPA and Hibernate
Introduction In this article, we are going to see how to use a UUID entity identifier that is auto-generated by Hibernate either in the JVM or using database-specific UUID functions. Our Post entity looks as follows: The Post entity has a UUID identifier and a title. Now, let’s see how we can map the Post entity so that the UUID identifier be auto-generated for us.
How to use database-specific or Hibernate-specific features without sacrificing portability
Introduction Like other non-functional requirements, portability is a feature. While portability is very important when working on an open-source framework that will be used in a large number of setups, for end systems, portability might not be needed at all. This article aims to explain that you don’t have to avoid database or framework-specific features if you want to achieve portability.
How to customize the Hypersistence Utils Jackson ObjectMapper
Introduction The Hypersistence Utils open-source project allows you to map JSON, and ARRAY when using JPA and Hibernate. Since I launched this project, one of the most wanted features was to add support for customizing the underlying Jackson ObjectMapper, and since version 2.1.1, this can be done either declaratively or programmatically. In this article, you are going to see how to customize the ObjectMapper when using the Hypersistence Utils project.
How to get the actual execution plan for an Oracle SQL query using Hibernate query hints
Introduction While answering this question on the Hibernate forum, I realized that it’s a good idea to write an article about getting the actual execution plan for an Oracle SQL query using Hibernate query hints feature.