title: SpringBatch JpaPagingItemReader SortOrder
body: <p>I am using SpringBatch version 3.0.7, Hibernate 4.3.11, and H2 database. When using the JpaPagingItemReader, does the JPQL require a unique sort order? I see that it is required for the JdbcPagingItemReader (see <a href="https://jira.spring.io/browse/BATCH-2465" rel="nofollow">BATCH-2465</a>).</p>
  
  <p>In a Step I am using a JpaPagingItemReader to load entities from the database and then write them to a flat file. I expect the flat file to contain unique entities sorted in the order specified by the JPQL. If I set the page size to something small, like 1, and then provide a JPQL statement that sorts entities with a non unique key, I am seeing the same entity repeat multiple times in the output file. If I sort by a unique key, there are no "duplicates". If I set the page size >= total number of entities, so there is only 1 page, there are no "duplicates".</p>
  
  <p>Empirically it would seem that the JpaPagingItemReader requires the JPQL to have a unique sort key.</p>