Mapping array with Hibernate

Hibernate (and JPA) can’t directly map the PostgreSQL array type. See this question for how to proceed if you really need to retain your database structure as it is. This thread has an example of the required custom type.

If you can change your schema, you can let hibernate create an additional table to handle the collection – List<Integer>. Then, depending on the version of hibernate you are using:

Leave a Comment