jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1503741 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/query/ oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ oak-core/src/main/java/org/apache/jackrabbit/oak/query/fulltext/ oak-core/src/test/java...
Date Tue, 16 Jul 2013 15:00:14 GMT
Author: thomasm
Date: Tue Jul 16 15:00:13 2013
New Revision: 1503741

URL: http://svn.apache.org/r1503741
Log: (empty)

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/AbstractQuery.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryParser.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultRowImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/XPathToSQL2Converter.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElement.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstVisitorBase.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SourceImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/fulltext/SimpleExcerptProvider.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/SQL2ParserTest.java
    jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndex.java

Added: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/AbstractQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/AbstractQuery.java?rev=1503741&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/AbstractQuery.java
(added)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/AbstractQuery.java
Tue Jul 16 15:00:13 2013
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.jackrabbit.oak.query;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.jackrabbit.oak.api.PropertyValue;
+import org.apache.jackrabbit.oak.api.Result;
+import org.apache.jackrabbit.oak.api.Tree;
+import org.apache.jackrabbit.oak.namepath.NamePathMapper;
+import org.apache.jackrabbit.oak.query.ast.ColumnImpl;
+import org.apache.jackrabbit.oak.query.ast.SelectorImpl;
+import org.apache.jackrabbit.oak.spi.state.NodeState;
+
+/**
+ * A "select" or "union" query.
+ */
+public interface AbstractQuery {
+
+    void setRootTree(Tree rootTree);
+
+    void setRootState(NodeState rootState);
+
+    void setNamePathMapper(NamePathMapper namePathMapper);
+
+    void setLimit(long limit);
+
+    void setOffset(long offset);
+
+    void bindValue(String key, PropertyValue value);
+
+    void setQueryEngine(QueryEngineImpl queryEngineImpl);
+
+    void prepare();
+
+    Result executeQuery();
+
+    List<String> getBindVariableNames();
+
+    ColumnImpl[] getColumns();
+
+    List<SelectorImpl> getSelectors();
+
+    Iterator<ResultRowImpl> getRows();
+
+    long getSize();
+
+}

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java?rev=1503741&r1=1503740&r2=1503741&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java
Tue Jul 16 15:00:13 2013
@@ -102,11 +102,11 @@ public abstract class QueryEngineImpl im
      */
     @Override
     public List<String> getBindVariableNames(String statement, String language) throws
ParseException {
-        Query q = parseQuery(statement, language);
+        AbstractQuery q = parseQuery(statement, language);
         return q.getBindVariableNames();
     }
 
-    private Query parseQuery(String statement, String language) throws ParseException {
+    private AbstractQuery parseQuery(String statement, String language) throws ParseException
{
         LOG.debug("Parsing {} statement: {}", language, statement);
         NodeState root = getRootState();
         NodeState system = root.getChildNode(JCR_SYSTEM);
@@ -146,7 +146,7 @@ public abstract class QueryEngineImpl im
         if (offset < 0) {
             throw new IllegalArgumentException("Offset may not be negative, is: " + offset);
         }
-        Query q = parseQuery(statement, language);
+        AbstractQuery q = parseQuery(statement, language);
         q.setRootTree(getRootTree());
         q.setRootState(getRootState());
         q.setNamePathMapper(namePathMapper);
@@ -166,7 +166,7 @@ public abstract class QueryEngineImpl im
         this.traversalFallback = traversal;
     }
 
-    public QueryIndex getBestIndex(Query query, NodeState rootState, Filter filter) {
+    public QueryIndex getBestIndex(QueryImpl query, NodeState rootState, Filter filter) {
         QueryIndex best = null;
         if (LOG.isDebugEnabled()) {
             LOG.debug("cost using filter " + filter);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryParser.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryParser.java?rev=1503741&r1=1503740&r2=1503741&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryParser.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryParser.java
Tue Jul 16 15:00:13 2013
@@ -40,6 +40,6 @@ public interface QueryParser {
      * @return parsed query
      * @throws ParseException if the query string could not be parsed
      */
-    Query parse(String query, String language) throws ParseException;
+    AbstractQuery parse(String query, String language) throws ParseException;
 
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultImpl.java?rev=1503741&r1=1503740&r2=1503741&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultImpl.java
Tue Jul 16 15:00:13 2013
@@ -29,9 +29,9 @@ import org.apache.jackrabbit.oak.query.a
  */
 public class ResultImpl implements Result {
 
-    protected final Query query;
+    protected final AbstractQuery query;
 
-    ResultImpl(Query query) {
+    ResultImpl(AbstractQuery query) {
         this.query = query;
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultRowImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultRowImpl.java?rev=1503741&r1=1503740&r2=1503741&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultRowImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultRowImpl.java
Tue Jul 16 15:00:13 2013
@@ -29,12 +29,12 @@ import org.apache.jackrabbit.oak.spi.que
  */
 public class ResultRowImpl implements ResultRow, Comparable<ResultRowImpl> {
 
-    private final Query query;
+    private final QueryImpl query;
     private final String[] paths;
     private final PropertyValue[] values;
     private final PropertyValue[] orderValues;
 
-    ResultRowImpl(Query query, String[] paths, PropertyValue[] values, PropertyValue[] orderValues)
{
+    ResultRowImpl(QueryImpl query, String[] paths, PropertyValue[] values, PropertyValue[]
orderValues) {
         this.query = query;
         this.paths = paths;
         this.values = values;
@@ -69,7 +69,7 @@ public class ResultRowImpl implements Re
         if (JcrConstants.JCR_PATH.equals(columnName)) {
             return PropertyValues.newString(getPath());
         }
-        if (columnName.startsWith(Query.REP_EXCERPT)) {
+        if (columnName.startsWith(QueryImpl.REP_EXCERPT)) {
             String ex = new SimpleExcerptProvider().getExcerpt(getPath(),
                     columnName, query, true);
             // missing excerpt, generate a default value

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java?rev=1503741&r1=1503740&r2=1503741&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java
Tue Jul 16 15:00:13 2013
@@ -112,7 +112,7 @@ public class SQL2Parser {
      * @return the query
      * @throws ParseException if parsing fails
      */
-    public Query parse(String query) throws ParseException {
+    public AbstractQuery parse(String query) throws ParseException {
         // TODO possibly support union,... as available at
         // http://docs.jboss.org/modeshape/latest/manuals/reference/html/jcr-query-and-search.html
 
@@ -130,8 +130,8 @@ public class SQL2Parser {
         read("SELECT");
         ArrayList<ColumnOrWildcard> list = parseColumns();
         if (supportSQL1) {
-            addColumnIfNecessary(list, Query.JCR_PATH, Query.JCR_PATH);
-            addColumnIfNecessary(list, Query.JCR_SCORE, Query.JCR_SCORE);
+            addColumnIfNecessary(list, QueryImpl.JCR_PATH, QueryImpl.JCR_PATH);
+            addColumnIfNecessary(list, QueryImpl.JCR_SCORE, QueryImpl.JCR_SCORE);
         }
         read("FROM");
         SourceImpl source = parseSource();
@@ -150,7 +150,7 @@ public class SQL2Parser {
         if (!currentToken.isEmpty()) {
             throw getSyntaxError("<end>");
         }
-        Query q = new Query(statement, source, constraint, orderings, columnArray);
+        QueryImpl q = new QueryImpl(statement, source, constraint, orderings, columnArray);
         q.setExplain(explain);
         q.setMeasure(measure);
         try {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/XPathToSQL2Converter.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/XPathToSQL2Converter.java?rev=1503741&r1=1503740&r2=1503741&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/XPathToSQL2Converter.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/XPathToSQL2Converter.java
Tue Jul 16 15:00:13 2013
@@ -299,14 +299,14 @@ public class XPathToSQL2Converter {
         
         // select ...
         buff.append("select ");
-        buff.append(new Property(currentSelector, Query.JCR_PATH).toString());
+        buff.append(new Property(currentSelector, QueryImpl.JCR_PATH).toString());
         if (selectors.size() > 1) {
-            buff.append(" as ").append('[').append(Query.JCR_PATH).append(']');
+            buff.append(" as ").append('[').append(QueryImpl.JCR_PATH).append(']');
         }
         buff.append(", ");
-        buff.append(new Property(currentSelector, Query.JCR_SCORE).toString());
+        buff.append(new Property(currentSelector, QueryImpl.JCR_SCORE).toString());
         if (selectors.size() > 1) {
-            buff.append(" as ").append('[').append(Query.JCR_SCORE).append(']');
+            buff.append(" as ").append('[').append(QueryImpl.JCR_SCORE).append(']');
         }
         if (columnList.isEmpty()) {
             buff.append(", ");

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElement.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElement.java?rev=1503741&r1=1503740&r2=1503741&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElement.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElement.java
Tue Jul 16 15:00:13 2013
@@ -19,14 +19,14 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.oak.api.Tree;
-import org.apache.jackrabbit.oak.query.Query;
+import org.apache.jackrabbit.oak.query.QueryImpl;
 
 /**
  * The base class for all abstract syntax tree nodes.
  */
 abstract class AstElement {
 
-    protected Query query;
+    protected QueryImpl query;
 
     abstract boolean accept(AstVisitor v);
 
@@ -44,7 +44,7 @@ abstract class AstElement {
         return '[' + pathOrName + ']';
     }
 
-    public void setQuery(Query query) {
+    public void setQuery(QueryImpl query) {
         this.query = query;
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstVisitorBase.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstVisitorBase.java?rev=1503741&r1=1503740&r2=1503741&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstVisitorBase.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstVisitorBase.java
Tue Jul 16 15:00:13 2013
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.Query;
+import org.apache.jackrabbit.oak.query.QueryImpl;
 
 /**
  * The base class to visit all elements.
@@ -128,7 +128,7 @@ public abstract class AstVisitorBase imp
      *
      * @param query the query to visit
      */
-    public void visit(Query query) {
+    public void visit(QueryImpl query) {
         query.getSource().accept(this);
         ConstraintImpl constraint = query.getConstraint();
         if (constraint != null) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java?rev=1503741&r1=1503740&r2=1503741&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java
Tue Jul 16 15:00:13 2013
@@ -25,7 +25,7 @@ import java.util.Set;
 import javax.jcr.PropertyType;
 
 import org.apache.jackrabbit.oak.api.PropertyValue;
-import org.apache.jackrabbit.oak.query.Query;
+import org.apache.jackrabbit.oak.query.QueryImpl;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
 import org.apache.jackrabbit.oak.spi.query.PropertyValues;
 
@@ -63,7 +63,7 @@ public class FullTextSearchScoreImpl ext
 
     @Override
     public PropertyValue currentProperty() {
-        PropertyValue p = selector.currentProperty(Query.JCR_SCORE);
+        PropertyValue p = selector.currentProperty(QueryImpl.JCR_SCORE);
         if (p == null) {
             // TODO if score() is not supported by the index, use the value 0.0?
             return PropertyValues.newDouble(0.0);
@@ -82,7 +82,7 @@ public class FullTextSearchScoreImpl ext
                 // not supported
                 return;
             }
-            f.restrictProperty(Query.JCR_SCORE, operator, v);
+            f.restrictProperty(QueryImpl.JCR_SCORE, operator, v);
         }
     }
     

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinImpl.java?rev=1503741&r1=1503740&r2=1503741&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinImpl.java
Tue Jul 16 15:00:13 2013
@@ -13,7 +13,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.Query;
+import org.apache.jackrabbit.oak.query.QueryImpl;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 
 /**
@@ -78,7 +78,7 @@ public class JoinImpl extends SourceImpl
     }
 
     @Override
-    public void init(Query query) {
+    public void init(QueryImpl query) {
         switch (joinType) {
         case INNER:
             left.addJoinCondition(joinCondition, false);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java?rev=1503741&r1=1503740&r2=1503741&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java
Tue Jul 16 15:00:13 2013
@@ -31,7 +31,7 @@ import org.apache.jackrabbit.oak.api.Pro
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.commons.PathUtils;
-import org.apache.jackrabbit.oak.query.Query;
+import org.apache.jackrabbit.oak.query.QueryImpl;
 import org.apache.jackrabbit.oak.query.SQL2Parser;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
 import org.apache.jackrabbit.oak.spi.query.PropertyValues;
@@ -89,7 +89,7 @@ public class PropertyValueImpl extends D
         // the jcr:path pseudo-property doesn't support LIKE conditions,
         // because the path doesn't might be escaped, and possibly contain
         // expressions that would result in incorrect results (/test[1] for example)
-        return !propertyName.equals(Query.JCR_PATH);
+        return !propertyName.equals(QueryImpl.JCR_PATH);
     }
     
     @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java?rev=1503741&r1=1503740&r2=1503741&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java
Tue Jul 16 15:00:13 2013
@@ -41,7 +41,7 @@ import org.apache.jackrabbit.oak.api.Pro
 import org.apache.jackrabbit.oak.api.PropertyValue;
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.commons.PathUtils;
-import org.apache.jackrabbit.oak.query.Query;
+import org.apache.jackrabbit.oak.query.QueryImpl;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
 import org.apache.jackrabbit.oak.spi.query.Cursor;
 import org.apache.jackrabbit.oak.spi.query.Cursors;
@@ -312,23 +312,23 @@ public class SelectorImpl extends Source
         if (t == null || !t.exists()) {
             return null;
         }
-        if (propertyName.equals(Query.JCR_PATH)) {
+        if (propertyName.equals(QueryImpl.JCR_PATH)) {
             String local = getLocalPath(path);
             if (local == null) {
                 // not a local path
                 return null;
             }
             return PropertyValues.newString(local);
-        } else if (propertyName.equals(Query.JCR_SCORE)) {
-            return currentRow.getValue(Query.JCR_SCORE);
-        } else if (propertyName.equals(Query.REP_EXCERPT)) {
-            return currentRow.getValue(Query.REP_EXCERPT);
+        } else if (propertyName.equals(QueryImpl.JCR_SCORE)) {
+            return currentRow.getValue(QueryImpl.JCR_SCORE);
+        } else if (propertyName.equals(QueryImpl.REP_EXCERPT)) {
+            return currentRow.getValue(QueryImpl.REP_EXCERPT);
         }
         return PropertyValues.create(t.getProperty(propertyName));
     }
 
     @Override
-    public void init(Query query) {
+    public void init(QueryImpl query) {
         // nothing to do
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SourceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SourceImpl.java?rev=1503741&r1=1503740&r2=1503741&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SourceImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SourceImpl.java
Tue Jul 16 15:00:13 2013
@@ -20,7 +20,7 @@ package org.apache.jackrabbit.oak.query.
 
 import java.util.ArrayList;
 
-import org.apache.jackrabbit.oak.query.Query;
+import org.apache.jackrabbit.oak.query.QueryImpl;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 
 /**
@@ -108,7 +108,7 @@ public abstract class SourceImpl extends
      *
      * @param query the query
      */
-    public abstract void init(Query query);
+    public abstract void init(QueryImpl query);
 
     /**
      * Get the selector with the given name, or null if not found.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/fulltext/SimpleExcerptProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/fulltext/SimpleExcerptProvider.java?rev=1503741&r1=1503740&r2=1503741&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/fulltext/SimpleExcerptProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/fulltext/SimpleExcerptProvider.java
Tue Jul 16 15:00:13 2013
@@ -23,7 +23,7 @@ import org.apache.jackrabbit.oak.api.Pro
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.commons.PathUtils;
-import org.apache.jackrabbit.oak.query.Query;
+import org.apache.jackrabbit.oak.query.QueryImpl;
 import org.apache.jackrabbit.oak.query.ast.AndImpl;
 import org.apache.jackrabbit.oak.query.ast.ConstraintImpl;
 import org.apache.jackrabbit.oak.query.ast.FullTextSearchImpl;
@@ -36,7 +36,7 @@ public class SimpleExcerptProvider {
 
     private static int maxFragmentSize = 150;
 
-    public String getExcerpt(String path, String columnName, Query query,
+    public String getExcerpt(String path, String columnName, QueryImpl query,
             boolean highlight) {
         if (path == null) {
             return null;

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java?rev=1503741&r1=1503740&r2=1503741&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java
Tue Jul 16 15:00:13 2013
@@ -267,7 +267,7 @@ public abstract class AbstractQueryTest 
 
     protected static String readRow(ResultRow row, boolean pathOnly) {
         if (pathOnly) {
-            return row.getValue(Query.JCR_PATH).getValue(Type.STRING);
+            return row.getValue(QueryImpl.JCR_PATH).getValue(Type.STRING);
         }
         StringBuilder buff = new StringBuilder();
         PropertyValue[] values = row.getValues();
@@ -424,7 +424,7 @@ public abstract class AbstractQueryTest 
                         values.add(Conversions.convert(value).toDouble());
                     } else if (type == PropertyType.DECIMAL) {
                         values.add(Conversions.convert(value).toDecimal());
-                    } else if(type == PropertyType.DATE) {
+                    } else if (type == PropertyType.DATE) {
                         values.add(Conversions.convert(value).toCalendar().getTimeInMillis());
                     } else {
                         values.add(value);

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/SQL2ParserTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/SQL2ParserTest.java?rev=1503741&r1=1503740&r2=1503741&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/SQL2ParserTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/SQL2ParserTest.java
Tue Jul 16 15:00:13 2013
@@ -27,6 +27,9 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.junit.Test;
 
+/**
+ * Tests the SQL-2 parser.
+ */
 public class SQL2ParserTest {
 
     private final NodeState types = new InitialContent().initialize(EMPTY_NODE)

Modified: jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndex.java?rev=1503741&r1=1503740&r2=1503741&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndex.java
Tue Jul 16 15:00:13 2013
@@ -31,7 +31,7 @@ import static org.apache.jackrabbit.oak.
 import static org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexConstants.TYPE_LUCENE;
 import static org.apache.jackrabbit.oak.plugins.index.lucene.TermFactory.newFulltextTerm;
 import static org.apache.jackrabbit.oak.plugins.index.lucene.TermFactory.newPathTerm;
-import static org.apache.jackrabbit.oak.query.Query.JCR_PATH;
+import static org.apache.jackrabbit.oak.query.QueryImpl.JCR_PATH;
 import static org.apache.lucene.search.BooleanClause.Occur.MUST;
 import static org.apache.lucene.search.BooleanClause.Occur.SHOULD;
 



Mime
View raw message