Notice
Recent Posts
Recent Comments
Link
목록2023/10/11 (1)
상똥이의 Back-End 공부방
[Board Project] 8. 메타데이터 공동 필드 추출하기
[0. 추출하는 이유와 방식] 1. 추출하는 이유 - Article.class, Article.Comment에는 공통적으로 들어가는 필드들이 있다. - Id, createdAt, creatredBy, modifiedAt, modifiedBy 등 - PK인 Id를 제외한 메타데이터 종류의 공통적인 필드들을 클래스 내에서 제거하면 코드를 간단히 할 수 있다. 2. 추출 방식 (1) @MappedSuperClass : 상속(extends)기반 구현 (2) @embedded [1. MappedSuperClass 기반 구현] (1) 경로 /main/java/프젝/domain에 AuditingFields.class 추가한다 (2) 클래스에 @MappedSuperclass 어노테이션을 삽입한다 (3) Article...
프로젝트/게시판 만들기
2023. 10. 11. 11:09