I am switching the ORM structure from Hibernate to OpenJPA.
In Hibernate, we could annotate the field with @ColumnTransformer, as shown below.
@Column(name = "EMP_NAME", length = 4000)
@ColumnTransformer(
read = "pgp_pub_decrypt(emp_name::bytea,dearmor('"+key1+"'))",
write = "pgp_pub_encrypt(?, dearmor('"+key2+"'))"
)
private String empName;
How to do the same in OpenJPA
source
share