Using pgcryto in Cuba Platform


We have a requirement to encrypt sensitive client information in our Postgres Database. For this, I want to use Postgres’ pgcryto module. For hibernate, I can use this function using @ColumnTransformer. Is there also an annotation like this I can use in Cuba?


There is no implementation for this Hibernate annotation in CUBA. You can try to use JPA lifecycle callbacks like pre-persist and post-load to encrypt data on entity commit and decrypt it after loading.

Also, you can have a look at @Convert JPA annotation, this also might help.