In hibernate, how does the array field of postgresql map a list < Object > through @ OneToMany?

I have an entity, for address and an entity, for Person, and he has an attribute address_ids; in it, which is an int [] type, which contains an array of address"s id.

how to map this address_ids field directly to an object of List < Address >.

or is there any other way to implement

I use spring data jpa

Mar.16,2021

because JDBC doesn't have this type, you have to implement the UserType interface of Hibernate yourself, and implement the mapping binding yourself.

Grails's postgresql plug-in learn about ? Its source code can be used as a reference to achieve the jsonb type and array type of postgresql.

this plug-in basically supports various data types of postgresql, which is done by defining UserType by yourself. The source code is under this package: https://github.com/kaleidos/g.

.
Menu