Skip to content

Commit

Permalink
refactor(Soft delete): @Builder.Default를 통한 boolean 객체 초기화 코드 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
limehee committed Jul 11, 2024
1 parent a83408a commit ac16764
Show file tree
Hide file tree
Showing 36 changed files with 36 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ public class ActivityGroup extends BaseEntity {
@URL(message = "{url.activityGroup.githubUrl}")
private String githubUrl;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;

public void update(ActivityGroupUpdateRequestDto requestDto) {
Optional.ofNullable(requestDto.getCategory()).ifPresent(this::setCategory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ public class ActivityGroupBoard extends BaseEntity {

private LocalDateTime dueDateTime;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;

public void update(ActivityGroupBoardUpdateRequestDto requestDto, UploadedFileService uploadedFileService) {
Optional.ofNullable(requestDto.getTitle()).ifPresent(this::setTitle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ public class ActivityGroupReport extends BaseEntity {
@Column(nullable = false)
private String content;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;

public void update(ActivityGroupReportUpdateRequestDto reportRequestDto) {
Optional.ofNullable(reportRequestDto.getTurn()).ifPresent(this::setTurn);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public class ReviewJpaEntity extends BaseEntity {
@Column(nullable = false)
private Boolean isPublic;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ public class Review {
private String memberId;
private String content;
private Boolean isPublic;

@Builder.Default
private boolean isDeleted = false;
private boolean isDeleted;
private LocalDateTime createdAt;

public void update(ReviewUpdateRequestDto requestDto) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public class AccuseJpaEntity extends BaseEntity {
@Size(min = 1, max = 1000, message = "{size.accuse.reason}")
private String reason;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public class BoardEmojiJpaEntity extends BaseEntity {

private LocalDateTime deletedAt;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public class BoardJpaEntity extends BaseEntity {
@Column(nullable = false)
private boolean wantAnonymous;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public class CommentJpaEntity extends BaseEntity {

private Long likes;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ public class Comment {
private List<Comment> children = new ArrayList<>();
private boolean wantAnonymous;
private Long likes;

@Builder.Default
private boolean isDeleted = false;
private boolean isDeleted;
private LocalDateTime createdAt;

public void update(CommentUpdateRequestDto commentUpdateRequestDto) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public class JobPostingJpaEntity extends BaseEntity {
@URL(message = "{url.jobPosting.jobPostingUrl}")
private String jobPostingUrl;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public class NewsJpaEntity extends BaseEntity {
@Column(nullable = false)
private LocalDate date;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ public class News {
private String articleUrl;
private String source;
private LocalDate date;

@Builder.Default
private boolean isDeleted = false;
private boolean isDeleted;
private LocalDateTime createdAt;

public void update(NewsUpdateRequestDto newsUpdateRequestDto) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ public class ApplicationJpaEntity extends BaseEntity {
@Column(nullable = false)
private Boolean isPass;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public class RecruitmentJpaEntity extends BaseEntity {
@Enumerated(EnumType.STRING)
private RecruitmentStatus status;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ public class Recruitment {
private ApplicationType applicationType;
private String target;
private RecruitmentStatus status;

@Builder.Default
private boolean isDeleted = false;
private boolean isDeleted;
private LocalDateTime updatedAt;

public void update(RecruitmentUpdateRequestDto recruitmentUpdateRequestDto) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public class BookJpaEntity extends BaseEntity {
@Version
private Long version;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public class BookLoanRecordJpaEntity extends BaseEntity {
@Enumerated(EnumType.STRING)
private BookLoanStatus status;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public class AwardJpaEntity extends BaseEntity {
@Column(name = "member_id", nullable = false)
private String memberId;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ public class MemberJpaEntity extends BaseEntity {

private Boolean isOtpEnabled;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ public class Member implements UserDetails {
private LocalDateTime lastLoginTime;
private LocalDateTime loanSuspensionDate;
private Boolean isOtpEnabled;

@Builder.Default
private boolean isDeleted = false;
private boolean isDeleted;
private LocalDateTime createdAt;

private Member(String id, String password, Role role) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public class NotificationJpaEntity extends BaseEntity {
@Size(min = 1, max = 1000, message = "{size.notification.content}")
private String content;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ public class Notification {
private Long id;
private String memberId;
private String content;

@Builder.Default
private boolean isDeleted = false;
private boolean isDeleted;
private LocalDateTime createdAt;

public static Notification create(String memberId, String content) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public class PositionJpaEntity extends BaseEntity {
@Column(nullable = false)
private String year;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ public class Position {
private String memberId;
private PositionType positionType;
private String year;

@Builder.Default
private boolean isDeleted = false;
private boolean isDeleted;

public static Position create(String memberId) {
return Position.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public class WorkExperienceJpaEntity extends BaseEntity {
@Column(name = "member_id", nullable = false)
private String memberId;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ public class WorkExperience {
private LocalDate startDate;
private LocalDate endDate;
private String memberId;

@Builder.Default
private boolean isDeleted = false;
private boolean isDeleted;

public void update(WorkExperienceUpdateRequestDto workExperienceUpdateRequestDto) {
Optional.ofNullable(workExperienceUpdateRequestDto.getCompanyName()).ifPresent(this::setCompanyName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public class ActivityPhotoJpaEntity extends BaseEntity {
@Column(nullable = false)
private Boolean isPublic;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public class BlogJpaEntity extends BaseEntity {

private String hyperlink;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public class DonationJpaEntity extends BaseEntity {
@Size(min = 1, max = 1000, message = "{size.donation.message}")
private String message;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public class MembershipFeeJpaEntity extends BaseEntity {
@Enumerated(EnumType.STRING)
private MembershipFeeStatus status;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ public class MembershipFee {
private String content;
private String imageUrl;
private MembershipFeeStatus status;

@Builder.Default
private boolean isDeleted = false;
private boolean isDeleted;
private LocalDateTime createdAt;

public void update(MembershipFeeUpdateRequestDto membershipFeeUpdateRequestDto) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public class ProductJpaEntity extends BaseEntity {
@URL(message = "{url.product.url}")
private String url;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ public class Product {
private String name;
private String description;
private String url;

@Builder.Default
private boolean isDeleted = false;
private boolean isDeleted;
private LocalDateTime createdAt;

public void update(ProductUpdateRequestDto productUpdateRequestDto) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public class ScheduleJpaEntity extends BaseEntity {
@JoinColumn(name = "activityGroup")
private ActivityGroup activityGroup;

@Builder.Default
@Column(name = "is_deleted", nullable = false)
private boolean isDeleted = false;
private boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ public class Schedule {
private SchedulePriority priority;
private String scheduleWriter;
private ActivityGroup activityGroup;

@Builder.Default
private boolean isDeleted = false;
private boolean isDeleted;

public void delete() {
this.isDeleted = true;
Expand Down

0 comments on commit ac16764

Please sign in to comment.