Spring Boot 2.4를 기준으로 환경별 프로필 설정하는 방법이 바뀌었다. Spring Boot 2.4 이전 spring: profiles: dev #활성 프로필 설정 profiles.include: - devdb # 추가할 프로필 설정 --- spring: profiles: local --- spring: profiles: dev --- spring: profiles: common --- spring: profiles: prod 👉 구분자 '---'를 사용해서 여러 프로필을 나누고, 각 파일마다 spring.profiles로 프로필을 설정한다. application.yml에서 spring.profiles로 활성 프로필을 설정하고, 추가할 프로필이 있다면 spring.profiles.include로..
Entity로 설정되지 않은(@Entity 를 쓰지 않은) 클래스에 @MappedSuperclass 를 붙이고 Entity에서 @MappedSuperclass 를 붙인 클래스를 상속받게 되면 부모 클래스에 설정된 필드가 Entity에 Column으로 자동으로 매핑된다. 👉 @MappedSuperclass 는 테이블과 매핑하지 않고 엔티티의 공통된 매핑 정보를 추가해주기 위해 사용 활용 예시 user 테이블과 post 테이블이 있을 때, 두 개의 테이블은 공통으로 createdDate(생성 시간), lastModifiedDate(수정 시간) 컬럼을 가지는 것으로 설계한다. 이때, 공통으로 들어가는 createdDate와 lastModifiedDate는 묶어서 BaseTimeEntity 클래스의 필드로 선언..