[MGNLTOOLS-79] jcrQueryUtils App: Provide possibility to define "LIMIT" and an offset Created: 26/Mar/15  Updated: 19/May/22  Resolved: 19/May/22

Status: Closed
Project: Repository Tools
Component/s: None
Affects Version/s: 1.5.2, 1.6.1
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Christian Ringele Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 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>


 Comments   
Comment by Roman Kovařík [ 19/May/22 ]

Hello,

This ticket is now marked as closed due to one of the following reasons:

  • A long period of inactivity
  • Uses an old or Beta version of an application, module, or framework that we no longer support
  • The issue is no longer reproducible or has been fixed in later versions

If you are still facing a problem or consider this issue still relevant, please feel free to re-open the ticket and we will reach out to you.

Thank you,
The Magnolia Team

Generated at Mon Feb 12 10:40:54 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.