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

Chetan Mehrotra commented on OAK-28:
------------------------------------

A minor fix is required in {{OsgiIndexProvider}} at Line 87

{code}
- return providers.get(0).getQueryIndexes(mk);
+ return providers.entrySet().iterator().next().getValue().getQueryIndexes(mk);
{code}

Could not find a better way to get the only value entry. One other way can be 
to use NavigableMap

{code}
- private final Map<ServiceReference, QueryIndexProvider> providers =
-        new HashMap<ServiceReference, QueryIndexProvider>();

+ private final NavigableMap<ServiceReference, QueryIndexProvider> providers =
+        new TreeMap<ServiceReference, QueryIndexProvider>();

{code}

And then

{code}
- return providers.get(0).getQueryIndexes(mk);
+ return providers.firstEntry().getValue().getQueryIndexes(mk);
{code}
                
> Query implementation
> --------------------
>
>                 Key: OAK-28
>                 URL: https://issues.apache.org/jira/browse/OAK-28
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: core, jcr
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>              Labels: query
>         Attachments: OakToJcrQueryTreeConverter.java
>
>
> A query engine needs to be implemented. 
> A query parser in oak-core should be able to handle xpath, sql2 and 
> optionally other query languages. The jcr component must generate a valid 
> query in one of those languages from JQOM queries and pass that statement 
> along with value bindings, limit, offset, and name space mappings to the 
> oak-core. 
> We need to:
> * Define the oak-core API for handling queries. How are do we handle name 
> space mappings, limit and offset
> * Implement a query builder in the jcr component which takes care of 
> translating JQOM queries to statements in string form 
> * Implement a query parser in oak-core and decide on a versatile AST 
> representation which works with all query languages and which is extensible 
> to future query languages.
> * Implement the actual query execution engine which interprets the query AST

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to