json
-
MySQL Json type을 Jpa로 다루기Computer Science/Spring boot 2022. 7. 15. 15:43
우선 json타입을 다룰려면 새로운 타입이여서 해당 dependency를 추가해주어야한다. implementation 'com.vladmihalcea:hibernate-types-52:${hibernate-types.version}' @Type(type = "json") @Column(columnDefinition = "json") private Test jsonObject; @NoArgsConstructor @Getter public class Test { private Long id; private Long tt; public Test(Long id, Long tt) { this.id = id; this.tt = tt; } } 위에 처럼 진행하여도 {"id":1,"tt":2} 로 입력된다. @Type..