JPA 기초 - @Embeddable을 사용하여 다른 테이블 매핑하기
·
JPA
본 내용 유튜브 최범균님의 강의 내용을 정리한 내용입니다. JPA 기초 07 @Embeddable 다른 테이블에 매핑하기 @Embeddable을 사용하여 다른 테이블 매핑 방법 1. @SecondaryTable + 테이블명 @Embeddable 어노테이션을 붙인 클래스의 필드에 @Column 어노테이션의 table 속성을 이용하여 매핑할 테이블을 명시합니다. // 작가 소개 정보를 담을 객체 package com.example.jpa.entity; ... @Data @NoArgsConstructor @AllArgsConstructor @Embeddable public class Intro { @Column(table = "writer_intro", name = "content_type") private ..