/** * Performs the actual reading of a page via the repository. * Available for overriding as needed. * * @return the list of items that make up the page * @throws Exception Based on what the underlying method throws or related to the * calling of the method */ @SuppressWarnings("unchecked") protected List<T> doPageRead() throws Exception { Pageable pageRequest = PageRequest.of(page, pageSize, sort); MethodInvoker invoker = createMethodInvoker(repository, methodName); List<Object> parameters = new ArrayList<>(); if(arguments != null && arguments.size() > 0) { parameters.addAll(arguments); } parameters.add(pageRequest); invoker.setArguments(parameters.toArray()); Page<T> curPage = (Page<T>) doInvoke(invoker); return curPage.getContent(); }
/** * Performs the actual reading of a page via the repository. * Available for overriding as needed. * * @return the list of items that make up the page * @throws Exception Based on what the underlying method throws or related to the * calling of the method */ @SuppressWarnings("unchecked") protected List<T> doPageRead() throws Exception { Pageable pageRequest = PageRequest.of(page, pageSize, sort); MethodInvoker invoker = createMethodInvoker(repository, methodName); List<Object> parameters = new ArrayList<>(); if(arguments != null && arguments.size() > 0) { parameters.addAll(arguments); } parameters.add(pageRequest); invoker.setArguments(parameters.toArray()); Page<T> curPage = (Page<T>) doInvoke(invoker); return curPage.getContent(); }