본문 바로가기

JPA

[JPA] Entity Map 을 Json 으로 Converter

Jpa Entity Column Map을 Json 타입으로 컨버팅하여 넣기

@TypeDef(name = "json", typeClass = JsonType::class) // Entity class 상단에 설정
@Type(type = "json")  // column 설정

 

참고사이트

https://blog.leocat.kr/notes/2020/09/01/hibernate-mapping-json-type-to-java-map

 

[Hibernate] Java Map 으로 json 타입 매핑하기

간혹 entity에 json 필드를 넣어야 할 때가 있다. child가 없는 1차원의 데이터라면 Java Map으로 사용하면 편하기 때문에 Map으로 변환하고 싶을 때는 이렇게 하면 된다.

blog.leocat.kr

 

'JPA' 카테고리의 다른 글

Jpa Mysql column 자료형  (0) 2020.11.05