Inspired by this comment on my blog, I decided to write an article about implementing a custom Hibernate type to support HSQLDB ARRAY column types.
As previously explained, although Hibernate does not support database ARRAY column types by default, you can easily implement a custom Hibernate
ArrayType. While the previous solution worked on PostgreSQL, in this article, you are going to see that it is fairly easy to adapt it to HSQLDB.
Continue reading “Hibernate HSQLDB ARRAY Type”
One of my blog readers asked me a very good question, and so I decided to turn the answer it into a blog post.
In this article, we are going to see how to order entity subclasses when executing a JPQL query with Hibernate.
Continue reading “How to order entity subclasses by their class type using JPA and Hibernate”
Recently, I got a very interesting request from one of my readers. Since I’ve been providing many custom types to support JSON, ARRAY or nullable
Character types, I decided to start a new open-source project to make it easier for you to get this extra Hibernate Types.
Continue reading “The hibernate-types open-source project is born”
Hibernate custom Types allow you to map all sorts of database specific column types, like IP address, JSON columns, bit sets or SQL arrays.
There are two ways to define a custom Hibernate Type:
The latter option is preferred since it allows you to better split the Java-to-JDBC and the JDBC-to-SQL type handling. In this article, we are going to see how you can map SQL arrays to their Java counterpart.
Continue reading “How to map Java and SQL arrays with JPA and Hibernate”
Mapping entities to database tables is usually a very straightforward process. However, if your mappings are rather unusual, you might bump into some rare issues like this one I found on the Hibernate forum.
In this article, I’m going to explain the mapping between Java objects to JDBC and database column types, and how you can fix the issue described in the aforementioned Hibernate question.
Continue reading “How to fix “wrong column type encountered” schema-validation errors with JPA and Hibernate”