title: Spring batch couchbase
body: <p>I would like to create a reader for a spring batch, reading from my couchbase database using Spring Data. </p>
  
  <p>Any ideas ?</p>
  
  <p>My actual reader : </p>
  
  <pre class="lang-java prettyprint-override"><code>@Bean
  public RepositoryItemReader&lt;Product&gt; reader() {
      LOGGER.info("Creating reader for Couchbase");
      RepositoryItemReader&lt;Product&gt; repositoryItemReader = new RepositoryItemReader&lt;&gt;();
      repositoryItemReader.setRepository(productRepository);
      repositoryItemReader.setMethodName("findBySource");
      repositoryItemReader.setPageSize(1000);
      Map&lt;String, Sort.Direction&gt; sort = new HashMap&lt;&gt;();
      List&lt;String&gt; parameters = new ArrayList();
      String source = "SOMESTRING";
      parameters.add(source);
      repositoryItemReader.setArguments(parameters);
      sort.put("field1", Sort.Direction.ASC);
      repositoryItemReader.setSort(sort);
      return repositoryItemReader;
  }
  </code></pre>
  
  <p>findBySource method is a custom repository method (through spring data) using a query ending by a Pageable paramerter as indicated in documentation. </p>
  
  <p>I know that a pull request has been created (BATCH-2275: added support to read/write from/to Couchbase #5) to do so but using Views which is not my case.</p>
  
  <p>Thank you for your help.</p>