Skip to content

Commit

Permalink
[refactor/#172] BaseEntity 변수명 변경
Browse files Browse the repository at this point in the history
Co-authored-by: skytin1004 <skytin1004@sms7950>
  • Loading branch information
skytin1004 and skytin1004 authored Nov 5, 2023
1 parent 01b1d82 commit 769ad6f
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public abstract class BaseEntity {

@CreatedDate
@Column(nullable = false, updatable = false, insertable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
private LocalDateTime created;
private LocalDateTime dateCreated;

@LastModifiedDate
@Column
private LocalDateTime updated;
private LocalDateTime dateUpdated;
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ public Page<BoardDto> findAllByMenuId(MenuId menuId, Pageable pageable) {
Expressions.asString("").as("contents"),
member.name.value,
normalBoard.menuId,
normalBoard.created,
normalBoard.updated))
normalBoard.dateCreated,
normalBoard.dateUpdated))
.from(normalBoard)
.innerJoin(member).on(eqMemberId())
.where(eqMenuId(menuId))
.offset(pageable.getOffset())
.limit(pageable.getPageSize())
.orderBy(normalBoard.created.desc())
.orderBy(normalBoard.dateCreated.desc())
.fetch();

return new PageImpl<>(results, pageable, this.getCount(menuId));
Expand All @@ -63,8 +63,8 @@ public Optional<BoardDto> findDtoById(Integer id) {
normalBoard.contents.value,
member.name.value,
normalBoard.menuId,
normalBoard.created,
normalBoard.updated))
normalBoard.dateCreated,
normalBoard.dateUpdated))
.from(normalBoard)
.innerJoin(member).on(eqMemberId())
.where(normalBoard.id.eq(id))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Page<BudgetApplicationListDto> search(ApplicationStatus status, Pageable
budgetSupportApplication.title.value,
budgetSupportApplication.applicationWriter.id,
applicant.name.value,
budgetSupportApplication.created,
budgetSupportApplication.dateCreated,
budgetSupportApplication.status
))
.from(budgetSupportApplication)
Expand Down Expand Up @@ -80,7 +80,7 @@ private JPAQuery<BudgetApplicationDetailDto> getDtoJPAQuery() {
budgetSupportApplication.id,
budgetSupportApplication.title.value,
budgetSupportApplication.dateUsed,
budgetSupportApplication.created,
budgetSupportApplication.dateCreated,
budgetSupportApplication.details.value,
budgetSupportApplication.outcome.value,
budgetSupportApplication.applicantAccount.value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ private JPAQuery<BudgetHistoryDetailDto> getDtoJPAQuery() {
Projections.constructor(BudgetHistoryDetailDto.class,
budgetHistory.id,
budgetHistory.dateUsed,
budgetHistory.created,
budgetHistory.updated,
budgetHistory.dateCreated,
budgetHistory.dateUpdated,
budgetHistory.title.value,
budgetHistory.income.value,
budgetHistory.outcome.value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static CommentDetailDto fromEntity(Comment comment) {
comment.getWriter().getId(),
comment.getWriter().getName(),
comment.getWriter().getSchoolInformation().getMajor(),
comment.getCreated()
comment.getDateCreated()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public List<CommentDetailDto> findAllByParentBoardIdOrderByCreated(Integer board
.innerJoin(comment.writer).fetchJoin()
.leftJoin(comment.parentComment).fetchJoin()
.where(comment.parentBoard.id.eq(boardId))
.orderBy(comment.created.asc(), comment.parentComment.id.asc().nullsFirst(), comment.id.asc())
.orderBy(comment.dateCreated.asc(), comment.parentComment.id.asc().nullsFirst(), comment.id.asc())
.fetch();

return convertToNestedStructure(comments);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public Optional<DetailContestBoardDto> findDtoById(Integer id) {
contestBoard.topic.value,
contestBoard.start,
contestBoard.deadline,
contestBoard.created,
contestBoard.updated
contestBoard.dateCreated,
contestBoard.dateUpdated
))
.from(contestBoard)
.innerJoin(member).on(contestBoard.writerId.eq(member.id))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public Optional<LectureDetailDto> getDetails(Integer id) {
lecture.status,
lecture.rejectReason,
lecture.paid,
lecture.created,
lecture.updated
lecture.dateCreated,
lecture.dateUpdated
))
.from(lecture)
.innerJoin(member).on(member.id.eq(lecture.chief))
Expand All @@ -71,7 +71,7 @@ public Page<LectureListDto> getList(Pageable pageable) {
.where(lecture.status.in(LectureStatus.PROGRESSING, LectureStatus.TERMINATED))
.offset(pageable.getOffset())
.limit(pageable.getPageSize())
.orderBy(lecture.created.desc())
.orderBy(lecture.dateCreated.desc())
.orderBy(lecture.status.asc())
.fetch();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public void createdTimeTest() {
em.persist(board);

//then
assertThat(board.getCreated()).isNotNull();
assertThat(board.getCreated()).isInstanceOf(LocalDateTime.class);
assertThat(board.getDateCreated()).isNotNull();
assertThat(board.getDateCreated()).isInstanceOf(LocalDateTime.class);
}

@Test
Expand All @@ -72,8 +72,8 @@ public void updatedTimeTest() {

//then
NormalBoard find = em.find(NormalBoard.class, board.getId());
assertThat(find.getUpdated()).isNotNull();
assertThat(find.getUpdated()).isInstanceOf(LocalDateTime.class);
assertThat(find.getDateUpdated()).isNotNull();
assertThat(find.getDateUpdated()).isInstanceOf(LocalDateTime.class);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void save() {
//then
assertAll(
() -> assertThat(saveBoard.getId()).isNotNull(),
() -> assertThat(saveBoard.getCreated()).isNotNull(),
() -> assertThat(saveBoard.getDateCreated()).isNotNull(),
() -> assertThat(saveBoard.getTitle()).isEqualTo(FREE_BOARD.getTitle()),
() -> assertThat(saveBoard.getContents()).isEqualTo(FREE_BOARD.getContents()),
() -> assertThat(saveBoard.getWriterId()).isEqualTo(saveMember.getId())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ public void CreateNewMenu() {

//then
assertThat(saveActivityMenu.getId()).isNotNull();
assertThat(saveActivityMenu.getCreated()).isNotNull();
assertThat(saveActivityMenu.getUpdated()).isNotNull();
assertThat(saveActivityMenu.getDateCreated()).isNotNull();
assertThat(saveActivityMenu.getDateUpdated()).isNotNull();
assertThat(saveActivityMenu)
.usingRecursiveComparison()
.ignoringFields("id", "created", "updated")
.ignoringFields("id", "dateCreated", "dateUpdated")
.isEqualTo(activityBoardMenu);
}

Expand Down

0 comments on commit 769ad6f

Please sign in to comment.