Skip to content

Commit

Permalink
fix(MapStruct): boolean 타입 변수명 'is' prefix로 인한 매핑 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
limehee committed Jul 19, 2024
1 parent ad922bb commit 918a2be
Show file tree
Hide file tree
Showing 73 changed files with 78 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public class ActivityGroup extends BaseEntity {
private String githubUrl;

@Column(name = "is_deleted", nullable = false)
private boolean isDeleted;
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 @@ -78,7 +78,7 @@ public class ActivityGroupBoard extends BaseEntity {
private LocalDateTime dueDateTime;

@Column(name = "is_deleted", nullable = false)
private boolean isDeleted;
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 @@ -48,7 +48,7 @@ public class ActivityGroupReport extends BaseEntity {
private String content;

@Column(name = "is_deleted", nullable = false)
private boolean isDeleted;
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 @@ -43,6 +43,7 @@ public static ActivityGroupBoard toEntity(ActivityGroupBoardRequestDto requestDt
.parent(parentBoard)
.uploadedFiles(uploadedFiles)
.dueDateTime(requestDto.getDueDateTime())
.isDeleted(false)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public static ActivityGroupReport toEntity(ActivityGroupReportRequestDto request
.activityGroup(activityGroup)
.title(requestDto.getTitle())
.content(requestDto.getContent())
.isDeleted(false)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public static ActivityGroup toEntity(ActivityGroupRequestDto requestDto) {
.endDate(requestDto.getEndDate())
.techStack(requestDto.getTechStack())
.githubUrl(requestDto.getGithubUrl())
.isDeleted(false)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ public class ReviewJpaEntity extends BaseEntity {
private Boolean isPublic;

@Column(name = "is_deleted", nullable = false)
private boolean isDeleted;
private Boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public static Review toEntity(ReviewRequestDto requestDto, String memberId, Acti
.memberId(memberId)
.content(requestDto.getContent())
.isPublic(false)
.isDeleted(false)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Review {
private String memberId;
private String content;
private Boolean isPublic;
private boolean isDeleted;
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 @@ -52,5 +52,5 @@ public class AccuseJpaEntity extends BaseEntity {
private String reason;

@Column(name = "is_deleted", nullable = false)
private boolean isDeleted;
private Boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public static Accuse toEntity(AccuseRequestDto requestDto, String memberId, Accu
.memberId(memberId)
.target(target)
.reason(requestDto.getReason())
.isDeleted(false)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class Accuse {
private String memberId;
private AccuseTarget target;
private String reason;
private boolean isDeleted;
private Boolean isDeleted;
private LocalDateTime createdAt;

public void updateReason(String reason) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ public class BoardEmojiJpaEntity extends BaseEntity {
private LocalDateTime deletedAt;

@Column(name = "is_deleted", nullable = false)
private boolean isDeleted;
private Boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ public class BoardJpaEntity extends BaseEntity {
private boolean wantAnonymous;

@Column(name = "is_deleted", nullable = false)
private boolean isDeleted;
private Boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public static Board toEntity(BoardRequestDto requestDto, String memberId, List<U
.uploadedFiles(uploadedFiles)
.imageUrl(requestDto.getImageUrl())
.wantAnonymous(requestDto.isWantAnonymous())
.isDeleted(false)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class Board {
private List<UploadedFile> uploadedFiles;
private String imageUrl;
private boolean wantAnonymous;
private boolean isDeleted;
private Boolean isDeleted;
private LocalDateTime createdAt;

public void update(BoardUpdateRequestDto boardUpdateRequestDto) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ public class BoardEmoji {
private Long boardId;
private String emoji;
private LocalDateTime deletedAt;
private boolean isDeleted;
private Boolean isDeleted;

public static BoardEmoji create(String memberId, Long boardId, String emoji) {
return BoardEmoji.builder()
.memberId(memberId)
.boardId(boardId)
.emoji(emoji)
.isDeleted(false)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ public class CommentJpaEntity extends BaseEntity {
private Long likes;

@Column(name = "is_deleted", nullable = false)
private boolean isDeleted;
private Boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private CommentJpaEntity toJpaEntity(Comment comment, Map<Long, CommentJpaEntity
.children(new ArrayList<>())
.wantAnonymous(comment.isWantAnonymous())
.likes(comment.getLikes())
.isDeleted(comment.isDeleted())
.isDeleted(comment.getIsDeleted())
.build();

mappedEntities.put(comment.getId(), entity);
Expand Down Expand Up @@ -64,7 +64,7 @@ private Comment toDomain(CommentJpaEntity entity, Map<Long, Comment> mappedDomai
.children(new ArrayList<>())
.wantAnonymous(entity.isWantAnonymous())
.likes(entity.getLikes())
.isDeleted(entity.isDeleted())
.isDeleted(entity.getIsDeleted())
.createdAt(entity.getCreatedAt())
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public static Comment toEntity(CommentRequestDto requestDto, Long boardId, Strin
.parent(parent)
.wantAnonymous(requestDto.isWantAnonymous())
.likes(0L)
.isDeleted(false)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class CommentMyResponseDto {
private LocalDateTime createdAt;

public static CommentMyResponseDto toDto(Comment comment, MemberDetailedInfoDto memberInfo, BoardCommentInfoDto boardInfo, boolean hasLikeByMe) {
if (comment.getBoardId() == null || comment.isDeleted()) {
if (comment.getBoardId() == null || comment.getIsDeleted()) {
return null;
}
return CommentMyResponseDto.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class CommentResponseDto {
private LocalDateTime createdAt;

public static CommentResponseDto toDto(Comment comment, MemberDetailedInfoDto memberInfo, boolean isOwner, List<CommentResponseDto> children) {
if (comment.isDeleted()) {
if (comment.getIsDeleted()) {
return CommentResponseDto.builder()
.id(comment.getId())
.isDeleted(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class Comment {
private List<Comment> children = new ArrayList<>();
private boolean wantAnonymous;
private Long likes;
private boolean isDeleted;
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 @@ -59,5 +59,5 @@ public class JobPostingJpaEntity extends BaseEntity {
private String jobPostingUrl;

@Column(name = "is_deleted", nullable = false)
private boolean isDeleted;
private Boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public static JobPosting toEntity(JobPostingRequestDto requestDto) {
.companyName(requestDto.getCompanyName())
.recruitmentPeriod(requestDto.getRecruitmentPeriod())
.jobPostingUrl(requestDto.getJobPostingUrl())
.isDeleted(false)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class JobPosting {
private String companyName;
private String recruitmentPeriod;
private String jobPostingUrl;
private boolean isDeleted;
private Boolean isDeleted;
private LocalDateTime createdAt;

public void update(JobPostingUpdateRequestDto jobPostingUpdateRequestDto) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ public class NewsJpaEntity extends BaseEntity {
private LocalDate date;

@Column(name = "is_deleted", nullable = false)
private boolean isDeleted;
private Boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public static News toEntity(NewsRequestDto requestDto) {
.articleUrl(requestDto.getArticleUrl())
.source(requestDto.getSource())
.date(requestDto.getDate())
.isDeleted(false)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class News {
private String articleUrl;
private String source;
private LocalDate date;
private boolean isDeleted;
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 @@ -93,5 +93,5 @@ public class ApplicationJpaEntity extends BaseEntity {
private Boolean isPass;

@Column(name = "is_deleted", nullable = false)
private boolean isDeleted;
private Boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public static Application toEntity(ApplicationRequestDto requestDto) {
.githubUrl(requestDto.getGithubUrl())
.applicationType(requestDto.getApplicationType())
.isPass(false)
.isDeleted(false)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class Application {
private String githubUrl;
private ApplicationType applicationType;
private Boolean isPass;
private boolean isDeleted;
private Boolean isDeleted;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ public class RecruitmentJpaEntity extends BaseEntity {
private RecruitmentStatus status;

@Column(name = "is_deleted", nullable = false)
private boolean isDeleted;
private Boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static Recruitment toEntity(RecruitmentRequestDto requestDto) {
.endDate(requestDto.getEndDate())
.applicationType(requestDto.getApplicationType())
.target(requestDto.getTarget())
.isDeleted(false)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Recruitment {
private ApplicationType applicationType;
private String target;
private RecruitmentStatus status;
private boolean isDeleted;
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 @@ -61,5 +61,5 @@ public class BookJpaEntity extends BaseEntity {
private Long version;

@Column(name = "is_deleted", nullable = false)
private boolean isDeleted;
private Boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public static Book toEntity(BookRequestDto requestDto) {
.publisher(requestDto.getPublisher())
.imageUrl(requestDto.getImageUrl())
.reviewLinks(requestDto.reviewLinks == null ? List.of() : requestDto.reviewLinks)
.isDeleted(false)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class Book {
private List<String> reviewLinks;
private String borrowerId;
private Long version;
private boolean isDeleted;
private Boolean isDeleted;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ public class BookLoanRecordJpaEntity extends BaseEntity {
private BookLoanStatus status;

@Column(name = "is_deleted", nullable = false)
private boolean isDeleted;
private Boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ public class BookLoanRecord {
private LocalDateTime dueDate;
private Long loanExtensionCount;
private BookLoanStatus status;
private boolean isDeleted;
private Boolean isDeleted;

public static BookLoanRecord create(Long bookId, MemberBorrowerInfoDto borrowerInfo) {
return BookLoanRecord.builder()
.bookId(bookId)
.borrowerId(borrowerInfo.getMemberId())
.loanExtensionCount(0L)
.status(BookLoanStatus.PENDING)
.isDeleted(false)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ public class AwardJpaEntity extends BaseEntity {
private String memberId;

@Column(name = "is_deleted", nullable = false)
private boolean isDeleted;
private Boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static Award toEntity(AwardRequestDto requestDto, String memberId) {
.awardName(requestDto.getAwardName())
.awardDate(requestDto.getAwardDate())
.memberId(memberId)
.isDeleted(false)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Award {
private String awardName;
private LocalDate awardDate;
private String memberId;
private boolean isDeleted;
private Boolean isDeleted;

public void update(AwardUpdateRequestDto requestDto) {
Optional.ofNullable(requestDto.getCompetitionName()).ifPresent(this::setCompetitionName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ public class MemberJpaEntity extends BaseEntity {
private Boolean isOtpEnabled;

@Column(name = "is_deleted", nullable = false)
private boolean isDeleted;
private Boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public static Member toEntity(MemberRequestDto requestDto) {
.imageUrl(requestDto.getImageUrl())
.role(Role.USER)
.isOtpEnabled(false)
.isDeleted(false)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class Member implements UserDetails {
private LocalDateTime lastLoginTime;
private LocalDateTime loanSuspensionDate;
private Boolean isOtpEnabled;
private boolean isDeleted;
private Boolean isDeleted;
private LocalDateTime createdAt;

private Member(String id, String password, Role role) {
Expand Down
Loading

0 comments on commit 918a2be

Please sign in to comment.