jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r426453 - in /jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query: QueryTreeDump.java xpath/QueryFormat.java
Date Fri, 28 Jul 2006 09:27:00 GMT
Author: mreutegg
Date: Fri Jul 28 02:26:59 2006
New Revision: 426453

URL: http://svn.apache.org/viewvc?rev=426453&view=rev
Log:
JCR-519: Missing support for some "general" relations in QueryTreeDump and xpath.QueryFormat

Modified:
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/xpath/QueryFormat.java

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java?rev=426453&r1=426452&r2=426453&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java
Fri Jul 28 02:26:59 2006
@@ -189,16 +189,24 @@
             buffer.append("= ");
         } else if (node.getOperation() == QueryConstants.OPERATION_EQ_VALUE) {
             buffer.append("eq");
+        } else if (node.getOperation() == QueryConstants.OPERATION_GE_GENERAL) {
+            buffer.append(">=");
         } else if (node.getOperation() == QueryConstants.OPERATION_GE_VALUE) {
             buffer.append("ge");
+        } else if (node.getOperation() == QueryConstants.OPERATION_GT_GENERAL) {
+            buffer.append("> ");
         } else if (node.getOperation() == QueryConstants.OPERATION_GT_VALUE) {
             buffer.append("gt");
         } else if (node.getOperation() == QueryConstants.OPERATION_IN) {
             buffer.append("IN");
+        } else if (node.getOperation() == QueryConstants.OPERATION_LE_GENERAL) {
+            buffer.append("<=");
         } else if (node.getOperation() == QueryConstants.OPERATION_LE_VALUE) {
             buffer.append("le");
         } else if (node.getOperation() == QueryConstants.OPERATION_LIKE) {
             buffer.append("LIKE");
+        } else if (node.getOperation() == QueryConstants.OPERATION_LT_GENERAL) {
+            buffer.append("< ");
         } else if (node.getOperation() == QueryConstants.OPERATION_LT_VALUE) {
             buffer.append("lt");
         } else if (node.getOperation() == QueryConstants.OPERATION_NE_GENERAL) {
@@ -209,6 +217,8 @@
             buffer.append("NOT NULL");
         } else if (node.getOperation() == QueryConstants.OPERATION_NULL) {
             buffer.append("IS NULL");
+        } else {
+            buffer.append("!!UNKNOWN OPERATION!!");
         }
         buffer.append(" Prop=" + node.getProperty());
         if (node.getValueType() == QueryConstants.TYPE_DATE) {

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/xpath/QueryFormat.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/xpath/QueryFormat.java?rev=426453&r1=426452&r2=426453&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/xpath/QueryFormat.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/xpath/QueryFormat.java
Fri Jul 28 02:26:59 2006
@@ -308,12 +308,21 @@
             } else if (node.getOperation() == OPERATION_EQ_GENERAL) {
                 sb.append(propName).append(" = ");
                 appendValue(node, sb);
+            } else if (node.getOperation() == OPERATION_GE_GENERAL) {
+                sb.append(propName).append(" >= ");
+                appendValue(node, sb);
             } else if (node.getOperation() == OPERATION_GE_VALUE) {
                 sb.append(propName).append(" ge ");
                 appendValue(node, sb);
+            } else if (node.getOperation() == OPERATION_GT_GENERAL) {
+                sb.append(propName).append(" > ");
+                appendValue(node, sb);
             } else if (node.getOperation() == OPERATION_GT_VALUE) {
                 sb.append(propName).append(" gt ");
                 appendValue(node, sb);
+            } else if (node.getOperation() == OPERATION_LE_GENERAL) {
+                sb.append(propName).append(" <= ");
+                appendValue(node, sb);
             } else if (node.getOperation() == OPERATION_LE_VALUE) {
                 sb.append(propName).append(" le ");
                 appendValue(node, sb);
@@ -322,14 +331,17 @@
                 sb.append("(").append(propName).append(", ");
                 appendValue(node, sb);
                 sb.append(")");
+            } else if (node.getOperation() == OPERATION_LT_GENERAL) {
+                sb.append(propName).append(" < ");
+                appendValue(node, sb);
             } else if (node.getOperation() == OPERATION_LT_VALUE) {
                 sb.append(propName).append(" lt ");
                 appendValue(node, sb);
-            } else if (node.getOperation() == OPERATION_NE_VALUE) {
-                sb.append(propName).append(" ne ");
-                appendValue(node, sb);
             } else if (node.getOperation() == OPERATION_NE_GENERAL) {
                 sb.append(propName).append(" != ");
+                appendValue(node, sb);
+            } else if (node.getOperation() == OPERATION_NE_VALUE) {
+                sb.append(propName).append(" ne ");
                 appendValue(node, sb);
             } else if (node.getOperation() == OPERATION_NULL) {
                 sb.append(NameFormat.format(XPathQueryBuilder.FN_NOT, resolver));



Mime
View raw message