You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Thomas Mueller (JIRA)" <ji...@apache.org> on 2015/04/17 12:25:59 UTC

[jira] [Comment Edited] (OAK-2785) Add QueryEngine.executeQuery without limit and offset

    [ https://issues.apache.org/jira/browse/OAK-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14499589#comment-14499589 ] 

Thomas Mueller edited comment on OAK-2785 at 4/17/15 10:24 AM:
---------------------------------------------------------------

+1

In addition to the limit and (most importantly) offset, most cases also seem to use NO_MAPPINGS. Could we just add a method:

{noformat}
executeQuery(String statement, String language, 
    Map<String, ? extends PropertyValue> bindings)
{noformat}

that calls:

{noformat}
executeQuery(statement, language, 
    Long.MAX_VALUE, 0, bindings, NO_MAPPINGS)
{noformat}



was (Author: tmueller):
+1

In addition to the limit and (most importantly) offset, most cases also seem to use NO_MAPPINGS. Could we just add a method:

{noformat}
executeQuery(String statement, String language, 
    Map<String, ? extends PropertyValue> bindings)
{noformat}

that calls:

{noformat}
executeQuery(String statement, String language, 
    Map<String, ? extends PropertyValue> bindings,
    Long.MAX_VALUE, 0, bindings, NO_MAPPINGS)
{noformat}


> Add QueryEngine.executeQuery without limit and offset
> -----------------------------------------------------
>
>                 Key: OAK-2785
>                 URL: https://issues.apache.org/jira/browse/OAK-2785
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core, query
>            Reporter: angela
>             Fix For: 1.3.0
>
>
> looking at queries executed in oak it seems that the vast majority doesn't set neither limit nor offset. Since there are not public constants available for NO_LIMIT and NO_OFFSET the corresponding values (i.e. Long.MAX_VALUE and 0 respectively) are repeatedly used. 
> since i found that i always have to look up how to indicated the NO_LIMIT, i would like to suggest that we either introduce constants for the 2 parameters or provide another {{executeQuery}} method that doesn't require to specify limit and offset (-> the constants might be kept private in this case).
> discussing with [~tmueller] it seemed that he would rather prefer the second approach.
> in any case it would allow us to make the various usages of {{QueryEngine.executeQuery}} more readable



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)