使用Projections.bean()
JPAQuery<AppServiceDetailVM> appServiceDetailVMJPAQuery = queryFactory.select(Projections.bean(
AppServiceDetailVM.class,
qAppService.id,
qAppService.appStackId,
qAppService.companyId
)).from(qAppService)
.leftJoin(qAppServiceProfile)
.on(qAppService.id.eq(qAppServiceProfile.serviceId))
.where(booleanBuilder)
.orderBy(qAppService.createTime.asc())
.limit(pageable.getPageSize())
.offset(pageable.getOffset());
List<AppServiceDetailVM> fetch = appServiceDetailVMJPAQuery.fetch();