The documentation states that “Hibernate doesn’t support native database array types”, but AFAIU, Hibernate ORM 6 does support them, so we should probably update the documentation? See https://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#collections-array-binary, section “2.9.16. Arrays”:
When discussing arrays, it is important to understand the distinction between SQL array types and Java arrays that are mapped as part of the application’s domain model.
Not all databases implement the SQL-99 ARRAY type and, for this reason, Hibernate doesn’t support native database array types.
Hibernate does support the mapping of arrays in the Java domain model - conceptually the same as mapping a List. However, it is important to realize that it is impossible for Hibernate to offer lazy-loading for arrays of entities and, for this reason, it is strongly recommended to map a "collection" of entities using a List rather than an array.
Also note this section is apparently using the same anchor ID as “2.9.6. Mapping Arrays”; we should probably fix that as well. |