jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1397221 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/ oak-core/src/main/java/org/apache/jackrabbit/oak/query/ oak-co...
Date Thu, 11 Oct 2012 18:33:27 GMT
Author: alexparvulescu
Date: Thu Oct 11 18:33:26 2012
New Revision: 1397221

URL: http://svn.apache.org/viewvc?rev=1397221&view=rev
Log:
OAK-371 Query package refactoring

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PropertyContentIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.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/UpperCaseImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValue.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValues.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PropertyContentIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PropertyContentIndex.java?rev=1397221&r1=1397220&r2=1397221&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PropertyContentIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PropertyContentIndex.java
Thu Oct 11 18:33:26 2012
@@ -20,12 +20,12 @@ package org.apache.jackrabbit.oak.plugin
 
 import java.util.Iterator;
 
-import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.query.index.IndexRowImpl;
 import org.apache.jackrabbit.oak.spi.query.Cursor;
 import org.apache.jackrabbit.oak.spi.query.Filter;
 import org.apache.jackrabbit.oak.spi.query.IndexRow;
+import org.apache.jackrabbit.oak.spi.query.PropertyValue;
 import org.apache.jackrabbit.oak.spi.query.QueryIndex;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 
@@ -71,7 +71,7 @@ public class PropertyContentIndex implem
         if (restriction == null) {
             throw new IllegalArgumentException("No restriction for " + propertyName);
         }
-        PropertyState first = restriction.first;
+        PropertyValue first = restriction.first;
         String f = first == null ? null : first.getValue(Type.STRING);
         // TODO revisit code after the removal of revisionId
         String revisionId = "";

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java?rev=1397221&r1=1397220&r2=1397221&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java
Thu Oct 11 18:33:26 2012
@@ -79,7 +79,7 @@ public class PropertyIndexLookup {
                 state = state.getChildNode(":index");
                 if (state != null) {
                     //TODO what happens when I search using an mvp?
-                    property = state.getProperty(PropertyIndex.encode(value).get(0));
+                    property = state.getProperty(PropertyIndex.encode(value.unwrap()).get(0));
                 }
             }
         }

Modified: 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/Query.java?rev=1397221&r1=1397220&r2=1397221&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/Query.java
Thu Oct 11 18:33:26 2012
@@ -482,7 +482,7 @@ public class Query {
         PropertyValue[] values = new PropertyValue[columnCount];
         for (int i = 0; i < columnCount; i++) {
             ColumnImpl c = columns[i];
-            values[i] = PropertyValues.create(c.currentProperty());
+            values[i] = c.currentProperty();
         }
         PropertyValue[] orderValues;
         if (orderings == null) {
@@ -491,7 +491,7 @@ public class Query {
             int size = orderings.length;
             orderValues = new PropertyValue[size];
             for (int i = 0; i < size; i++) {
-                orderValues[i] = PropertyValues.create(orderings[i].getOperand().currentProperty());
+                orderValues[i] = orderings[i].getOperand().currentProperty();
             }
         }
         return new ResultRowImpl(this, paths, values, orderValues);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java?rev=1397221&r1=1397220&r2=1397221&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java
Thu Oct 11 18:33:26 2012
@@ -18,9 +18,6 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import static org.apache.jackrabbit.oak.api.Type.STRING;
-import static org.apache.jackrabbit.oak.api.Type.STRINGS;
-
 import java.text.ParseException;
 import java.util.ArrayList;
 
@@ -31,6 +28,9 @@ import org.apache.jackrabbit.oak.query.a
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
 import org.apache.jackrabbit.oak.spi.query.PropertyValue;
 
+import static org.apache.jackrabbit.oak.api.Type.STRING;
+import static org.apache.jackrabbit.oak.api.Type.STRINGS;
+
 /**
  * A fulltext "contains(...)" condition.
  */
@@ -82,7 +82,7 @@ public class FullTextSearchImpl extends 
             if (p == null) {
                 return false;
             }
-            appendString(buff, p);
+            appendString(buff, p.unwrap());
         } else {
             Tree tree = getTree(selector.currentPath());
             if (tree == null) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java?rev=1397221&r1=1397220&r2=1397221&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java
Thu Oct 11 18:33:26 2012
@@ -20,7 +20,6 @@ package org.apache.jackrabbit.oak.query.
 
 import javax.jcr.PropertyType;
 
-import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
 import org.apache.jackrabbit.oak.spi.query.PropertyValue;
 import org.apache.jackrabbit.oak.spi.query.PropertyValues;
@@ -52,7 +51,7 @@ public class LengthImpl extends DynamicO
 
     @Override
     public PropertyValue currentProperty() {
-        PropertyState p = propertyValue.currentProperty();
+        PropertyValue p = propertyValue.currentProperty();
         if (p == null) {
             return null;
         }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java?rev=1397221&r1=1397220&r2=1397221&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java
Thu Oct 11 18:33:26 2012
@@ -18,13 +18,12 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import static org.apache.jackrabbit.oak.api.Type.STRING;
-
-import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
 import org.apache.jackrabbit.oak.spi.query.PropertyValue;
 import org.apache.jackrabbit.oak.spi.query.PropertyValues;
 
+import static org.apache.jackrabbit.oak.api.Type.STRING;
+
 /**
  * The function "lower(..)".
  */
@@ -52,7 +51,7 @@ public class LowerCaseImpl extends Dynam
 
     @Override
     public PropertyValue currentProperty() {
-        PropertyState p = operand.currentProperty();
+        PropertyValue p = operand.currentProperty();
         if (p == null) {
             return null;
         }

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=1397221&r1=1397220&r2=1397221&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
Thu Oct 11 18:33:26 2012
@@ -87,7 +87,7 @@ public class PropertyValueImpl extends D
         boolean asterisk = propertyName.equals("*");
         if (!relative && !asterisk) {
             PropertyValue p = selector.currentProperty(propertyName);
-            return matchesPropertyType(p) ? p : null;
+            return matchesPropertyType(p.unwrap()) ? p : null;
         }
         Tree tree = getTree(selector.currentPath());
         if (tree == null) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java?rev=1397221&r1=1397220&r2=1397221&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java
Thu Oct 11 18:33:26 2012
@@ -18,13 +18,12 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import static org.apache.jackrabbit.oak.api.Type.STRING;
-
-import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
 import org.apache.jackrabbit.oak.spi.query.PropertyValue;
 import org.apache.jackrabbit.oak.spi.query.PropertyValues;
 
+import static org.apache.jackrabbit.oak.api.Type.STRING;
+
 /**
  * The function "upper(..)".
  */
@@ -52,7 +51,7 @@ public class UpperCaseImpl extends Dynam
 
     @Override
     public PropertyValue currentProperty() {
-        PropertyState p = operand.currentProperty();
+        PropertyValue p = operand.currentProperty();
         if (p == null) {
             return null;
         }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValue.java?rev=1397221&r1=1397220&r2=1397221&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValue.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValue.java
Thu Oct 11 18:33:26 2012
@@ -27,7 +27,7 @@ import org.apache.jackrabbit.oak.api.Pro
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.util.ISO8601;
 
-public class PropertyValue implements PropertyState, Comparable<PropertyValue> {
+public class PropertyValue implements Comparable<PropertyValue> {
 
     private final PropertyState ps;
 
@@ -35,10 +35,6 @@ public class PropertyValue implements Pr
         this.ps = ps;
     }
 
-    public String getName() {
-        return ps.getName();
-    }
-
     public boolean isArray() {
         return ps.isArray();
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValues.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValues.java?rev=1397221&r1=1397220&r2=1397221&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValues.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValues.java
Thu Oct 11 18:33:26 2012
@@ -168,13 +168,13 @@ public class PropertyValues {
     /**
      * Convert a value to the given target type, if possible.
      * 
-     * @param v
+     * @param value
      *            the value to convert
      * @param targetType
      *            the target property type
      * @return the converted value, or null if converting is not possible
      */
-    public static PropertyValue convert(PropertyState value, int targetType,
+    public static PropertyValue convert(PropertyValue value, int targetType,
             NamePathMapper mapper) {
         // TODO support full set of conversion features defined in the JCR spec
         // at 3.6.4 Property Type Conversion

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java?rev=1397221&r1=1397220&r2=1397221&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
Thu Oct 11 18:33:26 2012
@@ -229,7 +229,7 @@ public class QueryResultImpl implements 
     }
 
     Value createValue(PropertyValue value) {
-        return value == null ? null : sessionDelegate.getValueFactory().createValue(CoreValues.getValue(value));
+        return value == null ? null : sessionDelegate.getValueFactory().createValue(CoreValues.getValue(value.unwrap()));
     }
 
 }



Mime
View raw message