How to encrypt and decrypt JSON properties with JPA
Introduction In this article, we are going to see how we can encrypt and decrypt JSON properties when using JPA and Hibernate. While encrypting the entire column value is very straightforward, when it comes to JSON columns, we need to preserve the JSON object structure while only encrypting the JSON property values.
How to map SQL Server JSON columns using JPA and Hibernate
Introduction In this article, we are going to see how easy it is to map an SQL Server JSON column when using the Hypersistence Utils project. The Hypersistence Utils project supports JSON column types for PostgreSQL and MySQL and Oracle, and, as you will see in this article, the JsonType works just fine with Microsoft SQL Server.
Mapping PostgreSQL Interval to Java Duration with Hibernate
Introduction In this article, we are going to see how to map the PostgreSQL interval column type to a Java Duration object using Hibernate and the Hypersistence Utils project. Another very useful feature introduced by the Hypersistence Utils project is that all types extending the ImmutableType can now be treated as standard org.hibernate.type.Type, therefore enabling a much better Hibernate Core API integration.
How to map a PostgreSQL Range column type with JPA and Hibernate
Introduction In this article, we are going to see how to map the PostgreSQL range column types with JPA and Hibernate. Luckily, you don’t have to implement a custom Hibernate type for the PostgreSQL range column type since the Hypersistence Utils project already provides support for it.
How to map the PostgreSQL inet type with JPA and Hibernate
Introduction In this article, we are going to see how to map the PostgreSQL inet type with JPA and Hibernate. Traditionally, PostgreSQL has been offering more column types than other relational database systems. And you don’t even have to implement these types I’m presenting here since they are available via the Hypersistence Utils project.
The best way to map the @DiscriminatorColumn with JPA and Hibernate
Introduction As previously explained, the SINGLE_TABLE inheritance is the most efficient entity inheritance strategy. However, for JPQL query such as this one: Hibernate generates a SQL query which filters by the associated discriminator column (e.g. DTYPE by default): So, because we are filtering by the discriminator column, we might want to index it or include it to speed up queries. However, the default STRING DiscriminatorType expects a VARCHAR column that must hold the longest entity subclass name. For the Announcement class, we need at least 12 bytes to store the entity class… Read More