Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refactor/#172] BaseEntity 변수명 변경 #173

Merged
merged 1 commit into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading