Examples of Pageable


Examples of org.springframework.data.domain.Pageable

      List<Long> totals = projection.getResultList();
      Long total = totals.size() == 1 ? totals.get(0) : totals.size();

      Query query = repositoryQuery.createQuery(values);
      ParameterAccessor accessor = new ParametersParameterAccessor(parameters, values);
      Pageable pageable = accessor.getPageable();

      List<Object> content = pageable == null || total > pageable.getOffset() ? query.getResultList() : Collections
          .emptyList();

      return new PageImpl<Object>(content, pageable, total);
    }
View Full Code Here

Examples of org.springframework.data.domain.Pageable

  }

  @Test
  public void returnsSamePageIfNoSpecGiven() throws Exception {

    Pageable pageable = new PageRequest(0, 1);

    flushTestUsers();
    assertThat(repository.findAll(null, pageable), is(repository.findAll(pageable)));
  }
View Full Code Here

Examples of org.springframework.data.domain.Pageable

                        .transform(FILE_ITEM_TRANSFORMER)
                        .toImmutableSet());
    }

    private Page<RawFile> getPagedFiles(long experimentId, PaginationItems.PagedItemInfo pageInfo) {
        Pageable request = toPageRequest(RawFile.class, pageInfo);
        return rawFilesRepository.findByExperiment(experimentId, request, toFilterQuery(pageInfo));
    }
View Full Code Here

Examples of org.springframework.data.domain.Pageable

                        .toImmutableSet()
        );
    }

    private Page<FileMetaData> filterPageableFile(long user, Filter filter, PaginationItems.PagedItemInfo pagedInfo) {
        Pageable request = toPageRequest(FileMetaData.class, pagedInfo);
        switch (filter) {
            case ALL:
                return fileMetaDataRepository.findAllStartingWith(user, toFilterQuery(pagedInfo), request);
            case SHARED_WITH_ME:
                return fileMetaDataRepository.findShared(user, request, toFilterQuery(pagedInfo));
View Full Code Here

Examples of org.springframework.data.domain.Pageable

                throw new AssertionError(filter);
        }
    }

    private Page<ProjectDashboardRecord> filterPageableProject(long user, Filter filter, PaginationItems.PagedItemInfo pagedInfo) {
        Pageable request = toPageRequest(ProjectDashboardRecord.class, pagedInfo);
        switch (filter) {
            case ALL:
                return projectRepository.findAllAvailable(user, toFilterQuery(pagedInfo), request);
            case SHARED_WITH_ME:
                return projectRepository.sharedProjects(user, request, toFilterQuery(pagedInfo));
View Full Code Here

Examples of org.springframework.data.domain.Pageable

                throw new AssertionError(filter);
        }
    }

    private Page<ExperimentDashboardRecord> filterPageableExperiment(long user, Filter filter, PaginationItems.PagedItemInfo pagedInfo) {
        Pageable request = toPageRequest(ExperimentDashboardRecord.class, pagedInfo);
        switch (filter) {
            case ALL:
                return experimentRepository.findAllAvailable(user, request, toFilterQuery(pagedInfo));
            case SHARED_WITH_ME:
                return experimentRepository.findShared(user, request, toFilterQuery(pagedInfo));
View Full Code Here

Examples of org.springframework.data.domain.Pageable

        Page<FileMetaData> pagedFiles = filesByInstrument(actor, instrument, pagedInfo);
        return getFileLinePagedItem(pagedFiles);
    }

    private Page<FileMetaData> filesByInstrument(long actor, long instrument, PaginationItems.PagedItemInfo pagedInfo) {
        Pageable request = toPageRequest(FileMetaData.class, pagedInfo);
        return fileMetaDataRepository.findByInstrument(instrumentRepository.findOne(instrument),
                actor, request, toFilterQuery(pagedInfo));
    }
View Full Code Here

Examples of org.springframework.data.domain.Pageable

        Page<ProjectDashboardRecord> pagedProjects = filterPageableProject(user, filter, pageInfo);
        return getProjectLinePagedItem(pagedProjects);
    }

    private Page<FileMetaData> readFilesByLab(long userId, long labId, PaginationItems.PagedItemInfo pagedInfo) {
        Pageable request = toPageRequest(FileMetaData.class, pagedInfo);
        return fileMetaDataRepository.findByLab(labId, userId, request, toFilterQuery(pagedInfo));
    }
View Full Code Here

Examples of org.springframework.data.domain.Pageable

  }

  @Override
  public Page<Operation> findNonCardOperationsByAccountIdAndYearMonth(Integer accountId, YearMonth yearMonth, int page) {

    Pageable pageable = new PageRequest(page, PAGE_SIZE);
    return operationDao.findNonCardByAccountIdAndYearMonth(accountId, yearMonth, pageable);
  }
View Full Code Here

Examples of org.springframework.data.domain.Pageable

    public void showPage() throws NotFoundException {
        long branchId = 1L;
        String page = "2";
        Branch branch = new Branch("name", "description");
        branch.setId(branchId);
        Pageable pageRequest = new PageRequest(2, 5);
        Page<Topic> topicsPage = new PageImpl<>(Collections.<Topic> emptyList(), pageRequest, 0);
        //set expectations
        when(branchService.get(branchId)).thenReturn(branch);
        when(topicFetchService.getTopics(branch, page)).thenReturn(topicsPage);
        when(breadcrumbBuilder.getForumBreadcrumb(branchService.get(branchId)))
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.