Skip to content

Commit

Permalink
Fix: AlbumDesign Entity 구성 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
unanchoi committed Jul 15, 2024
1 parent f51341f commit 405b9f1
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ public class Album extends BaseTimeEntity {

private String title = "기본 앨범";

@JoinColumn(name = "album_design_id")
@OneToOne(fetch = LAZY)
private AlbumDesign albumDesign;
private Long albumDesignId;

@Min(value = 1, message = "사진제한은 1장 이상이어야 합니다.")
private int photoLimit;
Expand All @@ -57,7 +55,7 @@ public void softDelete() {
@Builder
public Album(String title, AlbumDesign albumDesign, int photoLimit, String imageUrl, Member member) {
this.title = title;
this.albumDesign = albumDesign;
this.albumDesignId = albumDesign.getId();
this.photoLimit = photoLimit;
this.imageUrl = imageUrl;
this.member = member;
Expand All @@ -68,7 +66,7 @@ private void validatePhotoLimit(int photoLimit) {
}

public void updateAlbumDesign(AlbumDesign albumDesign) {
this.albumDesign = albumDesign;
this.albumDesignId = albumDesign.getId();
}

public void updateMember(Member member) {
Expand Down

0 comments on commit 405b9f1

Please sign in to comment.