Uploaded image for project: 'Spring Data Neo4j'
  1. Spring Data Neo4j
  2. DATAGRAPH-1146

Custom query with Pagination requires to add Count query

    Details

    • Type: Defect
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 5.1.2 (Lovelace SR2)
    • Fix Version/s: None
    • Component/s: CORE
    • Labels:
      None

      Description

      Hi,

      I am using Spring Data Neo4j,I have a lot of custom queries in my project with Pagination.

      I have recently updated Spring Data Neo4j to 5.1.2 RELEASE. I have find that for all my custom queries with pagination also need to define extra count query. 

      For e.g.

      @Query("MATCH (m:mynodeentity) WHERE m.type IN ['XXX','YYY'] RETURN m")
      Page<MyNodeEntity> findMyEnitityNodeByCode(@Param("type") String type, Pageable pageable);

      Now As per new problem due to 5.1.2 RELEASE, I needed to add count query like

      @Query(value="MATCH (m:mynodeentity) WHERE m.type IN ['XXX','YYY'] RETURN m", countQuery = "MATCH (m:mynodeentity) WHERE m.type IN ['XXX','YYY'] RETURN count(m) ")
      Page<MyNodeEntity> findMyEnitityNodeByCode(@Param("type") String type, Pageable pageable);
      

      this is an issue due to method countTotalNumberOfElements() in GraphQueryExecution.

        Attachments

          Activity

            People

            • Assignee:
              gerrit.meier Gerrit Meier
              Reporter:
              yogitest Yogendra
              Last updater:
              Yogendra
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: