jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1503743 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java
Date Tue, 16 Jul 2013 15:05:06 GMT
Author: thomasm
Date: Tue Jul 16 15:05:05 2013
New Revision: 1503743

URL: http://svn.apache.org/r1503743
Log:
OAK-904 Query: support "union" and "union all"

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java
      - copied, changed from r1503641, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java
(from r1503641, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java&r1=1503641&r2=1503743&rev=1503743&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java
Tue Jul 16 15:05:05 2013
@@ -67,7 +67,7 @@ import org.slf4j.LoggerFactory;
  * object. Call init() to initialize the bind variable map. If the query is
  * re-executed, a new instance is created.
  */
-public class Query {
+public class QueryImpl implements AbstractQuery {
     
     /**
      * The "jcr:path" pseudo-property.
@@ -85,7 +85,7 @@ public class Query {
      */
     public static final String REP_EXCERPT = "rep:excerpt";
 
-    private static final Logger LOG = LoggerFactory.getLogger(Query.class);
+    private static final Logger LOG = LoggerFactory.getLogger(QueryImpl.class);
 
     final SourceImpl source;
     final String statement;
@@ -106,7 +106,7 @@ public class Query {
     private NodeState rootState;
     private NamePathMapper namePathMapper;
 
-    Query(String statement, SourceImpl source, ConstraintImpl constraint, OrderingImpl[]
orderings,
+    QueryImpl(String statement, SourceImpl source, ConstraintImpl constraint, OrderingImpl[]
orderings,
           ColumnImpl[] columns) {
         this.statement = statement;
         this.source = source;
@@ -117,7 +117,7 @@ public class Query {
 
     public void init() {
 
-        final Query query = this;
+        final QueryImpl query = this;
 
         new AstVisitorBase() {
 
@@ -301,6 +301,7 @@ public class Query {
         }
     }
 
+    @Override
     public ColumnImpl[] getColumns() {
         return columns;
     }
@@ -317,14 +318,17 @@ public class Query {
         return source;
     }
 
-    void bindValue(String varName, PropertyValue value) {
+    @Override
+    public void bindValue(String varName, PropertyValue value) {
         bindVariableMap.put(varName, value);
     }
 
+    @Override
     public void setLimit(long limit) {
         this.limit = limit;
     }
 
+    @Override
     public void setOffset(long offset) {
         this.offset = offset;
     }
@@ -337,11 +341,13 @@ public class Query {
         this.measure = measure;
     }
 
+    @Override
     public ResultImpl executeQuery() {
         return new ResultImpl(this);
     }
 
-    Iterator<ResultRowImpl> getRows() {
+    @Override
+    public Iterator<ResultRowImpl> getRows() {
         prepare();
         Iterator<ResultRowImpl> it;
         if (explain) {
@@ -485,7 +491,8 @@ public class Query {
         return source.getPlan(rootState);
     }
 
-    void prepare() {
+    @Override
+    public void prepare() {
         if (prepared) {
             return;
         }
@@ -597,7 +604,7 @@ public class Query {
         return new ResultRowImpl(this, paths, values, orderValues);
     }
 
-    public int getSelectorIndex(String selectorName) {
+    int getSelectorIndex(String selectorName) {
         Integer index = selectorIndexes.get(selectorName);
         if (index == null) {
             throw new IllegalArgumentException("Unknown selector: " + selectorName);
@@ -605,7 +612,7 @@ public class Query {
         return index;
     }
 
-    public int getColumnIndex(String columnName) {
+    int getColumnIndex(String columnName) {
         for (int i = 0, size = columns.length; i < size; i++) {
             ColumnImpl c = columns[i];
             String cn = c.getColumnName();
@@ -624,14 +631,17 @@ public class Query {
         return v;
     }
 
+    @Override
     public List<SelectorImpl> getSelectors() {
         return Collections.unmodifiableList(selectors);
     }
 
+    @Override
     public List<String> getBindVariableNames() {
         return new ArrayList<String>(bindVariableMap.keySet());
     }
 
+    @Override
     public void setQueryEngine(QueryEngineImpl queryEngine) {
         this.queryEngine = queryEngine;
     }
@@ -640,14 +650,17 @@ public class Query {
         return queryEngine.getBestIndex(this, rootState, filter);
     }
 
+    @Override
     public void setRootTree(Tree rootTree) {
         this.rootTree = rootTree;
     }
     
+    @Override
     public void setRootState(NodeState rootState) {
         this.rootState = rootState;
     }
 
+    @Override
     public void setNamePathMapper(NamePathMapper namePathMapper) {
         this.namePathMapper = namePathMapper;
     }
@@ -699,6 +712,7 @@ public class Query {
         return buff.toString();
     }
 
+    @Override
     public long getSize() {
         return size;
     }



Mime
View raw message