Package org.springframework.data.domain

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


                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

                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

        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

        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

  }

  @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

    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

    @Test
    public void testViewList() throws NotFoundException {
        long branchId = 1L;
        String page = "2";
        Pageable pageRequest = new PageRequest(2, 5);
        Page<Topic> topicsPage = new PageImpl<>(Collections.<Topic> emptyList(), pageRequest, 0);
        Branch branch = new Branch("name", "description");
        branch.setId(branchId);
        //set expectations
        when(branchService.get(branchId)).thenReturn(branch);
View Full Code Here

        ArgumentCaptor<Pageable> pageSpecificationArgument = ArgumentCaptor.forClass(Pageable.class);
        verify(personRepositoryMock, times(1)).findAll(any(Predicate.class), pageSpecificationArgument.capture());
        verifyNoMoreInteractions(personRepositoryMock);

        Pageable pageSpecification = pageSpecificationArgument.getValue();

        assertEquals(PAGE_INDEX, pageSpecification.getPageNumber());
        assertEquals(PaginatingPersonRepositoryImpl.NUMBER_OF_PERSONS_PER_PAGE, pageSpecification.getPageSize());
        assertEquals(Sort.Direction.ASC, pageSpecification.getSort().getOrderFor(PROPERTY_LASTNAME).getDirection());

        assertEquals(expected, actual);
    }
View Full Code Here

     * Returns a new object which specifies the the wanted result page.
     * @param pageIndex The index of the wanted result page
     * @return
     */
    private Pageable constructPageSpecification(int pageIndex) {
        Pageable pageSpecification = new PageRequest(pageIndex, NUMBER_OF_PERSONS_PER_PAGE, sortByLastNameAsc());
        return pageSpecification;
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.domain.Pageable

Copyright © 2018 www.massapicom. 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.