Uploaded image for project: 'Repository Tools'
  1. Repository Tools
  2. MGNLTOOLS-79

jcrQueryUtils App: Provide possibility to define "LIMIT" and an offset

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Won't Do
    • Neutral
    • None
    • 1.5.2, 1.6.1
    • None

    Description

      JCR SQL2 provides the possibility to define LIMIT s and offsets:
      http://docs.jboss.org/jbossdna/0.7/manuals/reference/html/jcr-query-and-search.html#jcr-sql2-limits

      Limit ::= 'LIMIT' count [ 'OFFSET' offset ]
      count ::= /* Positive integer value */
      offset ::= /* Non-negative integer value */

      One can not set them over the app, and as a part of the query its not accepted:

      Doesn't work: SELECT * FROM [nt:base] WHERE ISDESCENDANTNODE([/demo-project/]) LIMIT 10
      

      One can use it by code:

      queryManager = MgnlContext.getJCRSession("website").getWorkspace().getQueryManager();
                  Query query = queryManager.createQuery("SELECT * FROM [nt:base] WHERE ISDESCENDANTNODE([/demo-project/])", Query.JCR_SQL2);
                  query.setLimit(10);
       QueryResult execute = query.execute();
      

      Which rally returns only 10 items.

      Would be great if this would be define-able in the jcrQueryUtils App.

      Error:

      javax.jcr.query.InvalidQueryException: Query:
      SELECT * FROM [nt:base] WHERE ISDESCENDANTNODE([/demo-project/]) LIMIT(*)10; expected: <end>
      

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              cringele Christian Ringele
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Task DoD