Hi,
I use the following to add access control lists to each row in the database: GitHub - arkhipov/acl: Access Control Lists (ACL) PostgreSQL Extension.
Briefly, this project add a custom type ace
to postgresql, which can then be added as an array column to each table.
Tables are changed as follows: ALTER TABLE public.principal ADD COLUMN acl ace[] NULL
.
I want to read/update ace[]
from my Spring Boot application using JPA.
I experimented with hypersistence (GitHub - vladmihalcea/hypersistence-utils: The Hypersistence Utils library (previously known as Hibernate Types) gives you Spring and Hibernate utilities that can help you get the most out of your data access layer.) and managed to extend the code with an acl
basic type and that works. Whart however does not work is an array of acl
. Reading the array from the database works, but setting the array not. It does correctly expand the ace fields as an array in the database.
Updating the array manually works with UPDATE public.principal SET ace = '{a/ihpc/acl_test1=wd}' WHERE id = '1';
Questions:
- Is it possible to use arrays of custom types with hibernate?
- Are there any directions, that point to right direction?
Best,
– Jaap