This forum thread details one approach which we could investigate to see if it's worth using on DBs that support passing ARRAY objects:
https://discourse.hibernate.org/t/postgres-createarrayof-for-batch-queries/863