Skip to content

Commit

Permalink
DATAGRAPH-895 - Auto-paging does not work when @query ends with ';'.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasperblues authored and luanne committed Aug 5, 2016
1 parent 37179a3 commit 398110e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Expand Up @@ -143,6 +143,10 @@ protected String addSorting(String baseQuery, Sort sort) {

protected String makePageable(String cypherQuery, Map<String, Object> queryParams, int pageNumber, int pageSize) {
//Custom queries in the OGM do not support pageable
cypherQuery = cypherQuery.trim();
if (cypherQuery.endsWith(";")) {
cypherQuery = cypherQuery.substring(0, cypherQuery.length() - 1);
}
cypherQuery = cypherQuery + SKIP_LIMIT;
queryParams.put(SKIP, pageNumber * pageSize);
if (graphQueryMethod.isSliceQuery()) {
Expand Down
Expand Up @@ -75,7 +75,7 @@ public interface CinemaRepository extends GraphRepository<Cinema> {

Cinema findByName(String name, @Depth int depth);

@Query("MATCH (n:Theatre) RETURN n")
@Query("MATCH (n:Theatre) RETURN n;")
Page<Cinema> getPagedCinemas(Pageable pageable);

@Query("MATCH (n:Theatre) RETURN n")
Expand Down

0 comments on commit 398110e

Please sign in to comment.