공통코드 모든 조회 쿼리 fetchJoin -> leftJoin으로 수정

This commit is contained in:
2025-12-11 11:29:41 +09:00
parent 979aab24f4
commit 2b38a317ba
2 changed files with 4 additions and 3 deletions

View File

@@ -58,11 +58,11 @@ public class CommonCodeRepositoryImpl implements CommonCodeRepositoryCustom {
return queryFactory
.selectFrom(commonCodeEntity)
.leftJoin(commonCodeEntity.children, child)
.fetchJoin()
.on(child.deleted.isFalse().or(child.deleted.isNull()))
.where(
commonCodeEntity.parent.isNull(),
commonCodeEntity.deleted.isFalse().or(commonCodeEntity.deleted.isNull()),
child.deleted.isFalse().or(child.deleted.isNull()))
commonCodeEntity.deleted.isFalse().or(commonCodeEntity.deleted.isNull())
)
.orderBy(commonCodeEntity.order.asc(), child.order.asc())
.fetch();
}