🔒 Data security (encryption) feature

JPA Entity with CryptoConverter

@Entity
@Table(name = "core_example")
public class ExampleEntity extends BaseModel {
    ...
    @Column(name = "crypto_text", length = Integer.MAX_VALUE)
    @Lob
    @Convert(converter = CryptoConverter.class)
    private String cryptoText;
    ...
}

Mybatis with TypeHandler

<resultMap id="exampleVo" type="org.chomookun.arch4j.core.example.vo.ExampleVo">
    ...
    <result property="cryptoText" column="crypto_text" typeHandler="org.chomookun.arch4j.core.common.data.typehandler.CryptoTypeHandler"/>
    ...
</resultMap>

<insert id="insertExample">
insert into core_example (
    ...
    crypto_text
    ...
) values (
    ...
    #{cryptoText, typeHandler=org.chomookun.arch4j.core.common.data.typehandler.CryptoTypeHandler}
    ...
)
</insert>