Skip to content
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 @@ -131,7 +131,6 @@ public List<ProjectSelectResponse> findProjectsBySearchConditionWithPaging(
projectRepository.findAllByStepAndNameWithPaging(step, null, page, projectPageSize);

final List<UUID> projectIds = projects.stream().map(Project::getId).toList();
projects.sort(Comparator.comparing(Project::getId));

final Map<UUID, ProjectAssign> projectIdAssignMap =
transformProjectAssignMap(projectAssignRepository.findAllByProjectIds(projectIds));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public List<CompanySelectResponse> findCompaniesBySearchConditionWithPaging(fina
eqDeleted(deleted),
containsKeyword(keywordType, keyword)
)
.orderBy(company.createdAt.desc())
.offset(offset)
.limit(companyPageSize)
.fetch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public List<MemberSelectResponse> findMembersBySearchWithPaging(int page, int me
.from(member)
.join(company).on(member.companyId.eq(company.id))
.where(builder)
.orderBy(member.id.desc())
.orderBy(member.createdAt.desc())
.offset(offset)
.limit(memberPageSize)
.fetch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public List<Project> findAllByStepAndNameWithPaging(final String step, final Str

return queryFactory.selectFrom(project)
.where(eqDeleted(false), eqProjectStep(step), containsProjectName(projectName))
.orderBy(project.createdAt.desc())
.limit(size)
.offset(offset)
.fetch();
Expand Down Expand Up @@ -189,6 +190,7 @@ public List<Project> findProjectsByIds(List<UUID> projectIds) {
return queryFactory
.selectFrom(project)
.where(project.id.in(projectIds))
.orderBy(project.createdAt.desc())
.fetch();
Comment on lines 190 to 194
Copy link

Copilot AI Jul 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding ordering to the findProjectsByIds method may produce unexpected results for callers who expect projects to be returned in the same order as the input projectIds list. Consider whether maintaining input order is important for this method's use cases.

Suggested change
return queryFactory
.selectFrom(project)
.where(project.id.in(projectIds))
.orderBy(project.createdAt.desc())
.fetch();
List<Project> projects = queryFactory
.selectFrom(project)
.where(project.id.in(projectIds))
.fetch();
// Reorder projects to match the order of projectIds
return projectIds.stream()
.map(id -> projects.stream().filter(p -> p.getId().equals(id)).findFirst().orElse(null))
.filter(p -> p != null)
.toList();

Copilot uses AI. Check for mistakes.
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public List<ProjectCheckListSelectResponse> findAllByProjectIdAndStepId(final UU
.from(projectCheckList)
.join(projectStep).on(projectCheckList.projectStepId.eq(projectStep.id))
.where(projectStep.projectId.eq(projectId), eqProjectStepId(projectStepId))
.orderBy(projectCheckList.createdAt.desc())
.fetch();
}

Expand Down
Loading