# How can @ColumnTransformer use the value inside application.yaml

**URL:** <https://discourse.hibernate.org/t/how-can-columntransformer-use-the-value-inside-application-yaml/3789>\
**Category:** Hibernate ORM\
**Created:** [February 25, 2020, 6:39am UTC](https://discourse.hibernate.org/t/how-can-columntransformer-use-the-value-inside-application-yaml/3789 "2020-02-25T06:39:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaximSungmo](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@MaximSungmo](https://discourse.hibernate.org/u/MaximSungmo)\
**Post date:** [February 25, 2020, 6:39am UTC](https://discourse.hibernate.org/t/how-can-columntransformer-use-the-value-inside-application-yaml/3789/1 "2020-02-25T06:39:32Z")

</div>

How can i put the encription\_key and encription\_type in the @ColumnTransformer Annotation ‘read’ or ‘write’ parameter from application.yaml

```auto
@ColumnTransformer(read = "convert_from(decrypt(decode(phone,'hex'), {encription key}, {encription method}),'utf8')", write = "encode(encrypt(convert_to(?,'utf8'),{encription key}, {encription method}),'hex')")

```

What i did is

1. get the value from application.yaml and put it in

```auto
    @Value("${codec.iv}")
    private final static String key="";

```

1. Use Database Custom function to return bytea::encription\_key - it is works but not want to
2. HardCoding
3. I also see that using postgres.conf - not want.

What i want to do is  
get the key and encription\_method from external files(like application.yaml etc…)
