본문 바로가기
Spring Boot

[JPA] @Entity @Table 차이점

by palbokdev 2022. 9. 14.

@Entity : 해당 클래스가 엔티티 혹은 테이블임을 나타냄

@Table : 테이블의 이름을 설정해 주는 역할 (필수가 아님)

 

@Table이 없을 시 @Entity에서 설정한 name 혹은 클래스 이름 기반으로 생성됨

 

ref : https://stackoverflow.com/questions/7259273/whats-the-difference-between-the-name-argument-in-entity-and-table-when-using