반응형
[QueryDSL] SELF JOIN 셀프조인
QCategory category1 = new QCategory("category1");
QCategory category2 = new QCategory("category2");
factory
.select(
Projections.fields(
...DTO.class,
category1.categoryCode.as("parentCategoryCode"),
category2.categoryCode,
...
)
)
.from(category1, category2)
.where(
category1.categoryCode.eq(category2.parentCategoryCode)
)
반응형
LIST