jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r770669 - /jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/Operator.java
Date Fri, 01 May 2009 13:25:14 GMT
Author: jukka
Date: Fri May  1 13:25:14 2009
New Revision: 770669

URL: http://svn.apache.org/viewvc?rev=770669&view=rev
Log:
JCR-2094: Use an enumeration for QOM operators

Add a utility method for creating a Comparison from an Operator and two operands

Modified:
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/Operator.java

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/Operator.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/Operator.java?rev=770669&r1=770668&r2=770669&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/Operator.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/Operator.java
Fri May  1 13:25:14 2009
@@ -16,7 +16,11 @@
  */
 package org.apache.jackrabbit.spi.commons.query.qom;
 
+import javax.jcr.RepositoryException;
+import javax.jcr.query.qom.Comparison;
+import javax.jcr.query.qom.DynamicOperand;
 import javax.jcr.query.qom.QueryObjectModelConstants;
+import javax.jcr.query.qom.QueryObjectModelFactory;
 
 /**
  * Enumeration of the JCR 2.0 query operators.
@@ -67,6 +71,22 @@
     }
 
     /**
+     * Returns a comparison between the given operands using this operator.
+     *
+     * @param factory factory for creating the comparison
+     * @param left operand on the left hand side
+     * @param right operand on the right hand side
+     * @return comparison
+     * @throws RepositoryException if the comparison can not be created
+     */
+    public Comparison comparison(
+            QueryObjectModelFactory factory,
+            DynamicOperand left, StaticOperandImpl right)
+            throws RepositoryException {
+        return factory.comparison(left, name, right);
+    }
+
+    /**
      * Formats an XPath constraint with this operator and the given operands.
      * The operands are simply used as-is, without any quoting or escaping.
      *



Mime
View raw message