Spring Boot 註解加密隱私信息

一、註解字段:
@Column(name = "phone", length = 100)
@ColumnTransformer(read = "AES_DECRYPT(UNHEX(phone), 'aes_phone')", write = "HEX(AES_ENCRYPT(?, 'aes_phone'))")
private String phone;
二、原生SQL 查詢加密數據:
SELECT AES_DECRYPT(UNHEX(s.phone),'aes_phone') FROM TABLSE s ide

相關文章
相關標籤/搜索