joerghoh commented on a change in pull request #22:
URL: 
https://github.com/apache/sling-org-apache-sling-jcr-resource/pull/22#discussion_r838170729



##########
File path: 
src/main/java/org/apache/sling/jcr/resource/internal/helper/JcrResourceUtil.java
##########
@@ -54,6 +54,25 @@ public static QueryResult query(Session session, String 
query,
             String language) throws RepositoryException {
         QueryManager qManager = session.getWorkspace().getQueryManager();
         Query q = qManager.createQuery(query, language);
+
+        return q.execute();
+    }
+
+    /**
+     * Helper method to execute a JCR query with a limit
+     * 
+     * @param session  the session
+     * @param query    the query
+     * @param language the language
+     * @param limit    the limit to the number of results to return

Review comment:
       ```suggestion
        * @param limit    the maximum number of results to return; -1 if the 
result set should not be limited
   ```

##########
File path: 
src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
##########
@@ -103,6 +106,15 @@
         IGNORED_PROPERTIES.add("jcr:createdBy");
     }
 
+    @ObjectClassDefinition(name = "Apache Sling JCR Resource Provider", 
description = "Provides Sling resources based on the Java Content Repository")
+    public @interface Config {
+
+        @AttributeDefinition(name = "Enable Query Limit", description = "If 
set to true, the JcrResourceProvider will set a default limit for all other 
queries using the findResources / queryResources methods")

Review comment:
       ```suggestion
           @AttributeDefinition(name = "Enable Query Limit", description = "If 
set to true, the JcrResourceProvider will set a default limit for all queries 
using the findResources / queryResources methods")
   ```

##########
File path: 
src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
##########
@@ -103,6 +106,15 @@
         IGNORED_PROPERTIES.add("jcr:createdBy");
     }
 
+    @ObjectClassDefinition(name = "Apache Sling JCR Resource Provider", 
description = "Provides Sling resources based on the Java Content Repository")
+    public @interface Config {
+
+        @AttributeDefinition(name = "Enable Query Limit", description = "If 
set to true, the JcrResourceProvider will set a default limit for all other 
queries using the findResources / queryResources methods")
+        boolean enable_query_limit() default false;
+
+        @AttributeDefinition(name = "Query Limit", description = "The default 
query limit for queries using the findResources / queryResources methods")

Review comment:
       ```suggestion
           @AttributeDefinition(name = "Query Limit", description = "The 
default query limit for queries using the findResources / queryResources 
methods. It will only take effect if the query limit feature is enabled.")
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to