public Page<Application> selectApplications( String userId, String orderBy, int pageSize, int pageNumber) { QApplication application = QApplication.application; BooleanExpression userEq = application.userId.eq(userId); Sort sort = PageUtils.toSort(orderBy); Pageable pageable = new PageRequest(pageNumber, pageSize, sort); return applicationRepository.findAll(userEq, pageable); }
public Page<Instance> selectInstances(long appId, String orderBy, int pageSize, int pageNumber) { QInstance instance = QInstance.instance; Sort sort = PageUtils.toSort(orderBy); Pageable pageable = new PageRequest(pageNumber, pageSize, sort); return instanceRepository.findAll(instance.appId.eq(appId), pageable); }