jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1126527 - in /jackrabbit/branches/2.2: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query...
Date Mon, 23 May 2011 15:05:41 GMT
Author: alexparvulescu
Date: Mon May 23 15:05:40 2011
New Revision: 1126527

URL: http://svn.apache.org/viewvc?rev=1126527&view=rev
Log:
2.2: merged revisions 1080186,1080540,1064670 (JCR-2933)

Added:
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ConstraintSplitInfo.java
      - copied unchanged from r1080186, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ConstraintSplitInfo.java
Modified:
    jackrabbit/branches/2.2/   (props changed)
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryHandlerContext.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/CommittableIndexReader.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/FieldSelectors.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexHistory.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexMerger.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NamePathResolverImpl.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PropertiesSynonymProvider.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WeightedHighlighter.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ChildNodeJoinMerger.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ConstraintSplitter.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/DescendantNodeJoinMerger.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/EquiJoinMerger.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/JoinMerger.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/JoinRow.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/QueryEngine.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/SameNodeJoinMerger.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ScoreNodeMap.java
    jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/JoinTest.java

Propchange: jackrabbit/branches/2.2/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon May 23 15:05:40 2011
@@ -2,4 +2,4 @@
 /jackrabbit/sandbox/JCR-1456:774917-886178
 /jackrabbit/sandbox/JCR-2170:812417-816332
 /jackrabbit/sandbox/tripod-JCR-2209:795441-795863
-/jackrabbit/trunk:1038201,1038203,1038205,1038657,1039064,1039347,1039408,1039422-1039423,1039888,1039946,1040033,1040090,1040459,1040601,1040606,1040661,1040958,1041379,1041439,1041761,1042643,1042647,1042978-1042982,1043084-1043086,1043088,1043343,1043357-1043358,1043430,1043554,1043616,1043618,1043637,1043656,1043893,1043897,1044239,1044312,1044451,1044613,1049473,1049491,1049514,1049518,1049520,1049859,1049870,1049874,1049878,1049880,1049883,1049889,1049891,1049894-1049895,1049899-1049901,1049909-1049911,1049915-1049916,1049919,1049923,1049925,1049931,1049936,1049939,1050212,1050298,1050346,1050551,1055068,1055070-1055071,1055116-1055117,1055127,1055134,1055164,1055498,1060431,1060434,1060753,1063756,1065599,1065622,1066059,1066071,1069831,1071562,1071573,1071680,1074140,1079314,1079317,1087304,1088991,1089032,1089053,1089436,1092106,1092117,1097513-1097514,1098963-1098964,1099033
+/jackrabbit/trunk:1038201,1038203,1038205,1038657,1039064,1039347,1039408,1039422-1039423,1039888,1039946,1040033,1040090,1040459,1040601,1040606,1040661,1040958,1041379,1041439,1041761,1042643,1042647,1042978-1042982,1043084-1043086,1043088,1043343,1043357-1043358,1043430,1043554,1043616,1043618,1043637,1043656,1043893,1043897,1044239,1044312,1044451,1044613,1049473,1049491,1049514,1049518,1049520,1049859,1049870,1049874,1049878,1049880,1049883,1049889,1049891,1049894-1049895,1049899-1049901,1049909-1049911,1049915-1049916,1049919,1049923,1049925,1049931,1049936,1049939,1050212,1050298,1050346,1050551,1055068,1055070-1055071,1055116-1055117,1055127,1055134,1055164,1055498,1060431,1060434,1060753,1063756,1064670,1065599,1065622,1066059,1066071,1069831,1071562,1071573,1071680,1074140,1079314,1079317,1080186,1080540,1087304,1088991,1089032,1089053,1089436,1092106,1092117,1097513-1097514,1098963-1098964,1099033

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java
Mon May 23 15:05:40 2011
@@ -120,7 +120,7 @@ public class PropertyTypeRegistry implem
     }
 
     public void nodeTypesUnregistered(Collection<Name> names) {
-        // remove all TypeMapping instances refering to this ntName
+        // remove all TypeMapping instances referring to this ntName
         synchronized (typeMapping) {
             Map<Name, TypeMapping[]> modified = new HashMap<Name, TypeMapping[]>();
             for (Iterator it = typeMapping.keySet().iterator(); it.hasNext();) {

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryHandlerContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryHandlerContext.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryHandlerContext.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryHandlerContext.java
Mon May 23 15:05:40 2011
@@ -188,7 +188,7 @@ public class QueryHandlerContext {
      * Returns the id of the node that should be excluded from indexing. Any
      * descendant of this node is also excluded from indexing.
      *
-     * @return the uuid of the exluded node.
+     * @return the uuid of the excluded node.
      */
     public NodeId getExcludedNodeId() {
         return excludedNodeId;

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java
Mon May 23 15:05:40 2011
@@ -231,7 +231,7 @@ public class QueryImpl extends AbstractQ
      */
     public void setLimit(long limit) {
         if (limit < 0) {
-            throw new IllegalArgumentException("limit must not be negativ");
+            throw new IllegalArgumentException("limit must not be negative");
         }
         this.limit = limit;
     }
@@ -243,7 +243,7 @@ public class QueryImpl extends AbstractQ
      */
     public void setOffset(long offset) {
         if (offset < 0) {
-            throw new IllegalArgumentException("offset must not be negativ");
+            throw new IllegalArgumentException("offset must not be negative");
         }
         this.offset = offset;
     }

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/CommittableIndexReader.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/CommittableIndexReader.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/CommittableIndexReader.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/CommittableIndexReader.java
Mon May 23 15:05:40 2011
@@ -29,7 +29,7 @@ import java.io.IOException;
 class CommittableIndexReader extends FilterIndexReader {
 
     /**
-     * A modification count on this index reader. Initialied with
+     * A modification count on this index reader. Initialized with
      * {@link IndexReader#getVersion()} and incremented with every call to
      * {@link #doDelete(int)}.
      */

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/FieldSelectors.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/FieldSelectors.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/FieldSelectors.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/FieldSelectors.java
Mon May 23 15:05:40 2011
@@ -25,7 +25,7 @@ import org.apache.lucene.document.FieldS
 public class FieldSelectors {
 
     /**
-     * Do not instanciate.
+     * Do not instantiate.
      */
     private FieldSelectors() {
     }

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexHistory.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexHistory.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexHistory.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexHistory.java
Mon May 23 15:05:40 2011
@@ -104,7 +104,7 @@ class IndexHistory {
      * <li>{@link Long#MIN_VALUE}: indicates that there is no index segment with the
given name.</li>
      * </ul>
      *
-     * @param indexName name of an index segement.
+     * @param indexName name of an index segment.
      * @return the time when the index segment with the given name was in use
      *          the last time.
      */

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexMerger.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexMerger.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexMerger.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexMerger.java
Mon May 23 15:05:40 2011
@@ -92,8 +92,8 @@ class IndexMerger implements IndexListen
 
     /**
      * Read/write lock for index segment replacement. A shared read lock is
-     * aquired for an index replacement. An exclusive write lock is acquired
-     * when this index merger is shuting down, to prevent further index
+     * acquired for an index replacement. An exclusive write lock is acquired
+     * when this index merger is shutting down, to prevent further index
      * replacements.
      */
     private final ReadWriteLock indexReplacement = new ReentrantReadWriteLock();

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
Mon May 23 15:05:40 2011
@@ -74,7 +74,7 @@ import org.slf4j.LoggerFactory;
  * This class is thread-safe.
  * <p/>
  * Note on implementation: Multiple modifying threads are synchronized on a
- * <code>MultiIndex</code> instance itself. Sychronization between a modifying
+ * <code>MultiIndex</code> instance itself. Synchronization between a modifying
  * thread and reader threads is done using {@link #updateMonitor} and
  * {@link #updateInProgress}.
  */

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NamePathResolverImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NamePathResolverImpl.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NamePathResolverImpl.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NamePathResolverImpl.java
Mon May 23 15:05:40 2011
@@ -89,7 +89,7 @@ public class NamePathResolverImpl extend
         /**
          * Returns the qualified JCR name for the given <code>Name</code>.
          * Note, that the JCR prefix is always retrieved from the NamespaceResolver
-         * even if the name is in the defaut namespace. This is a special treatement
+         * even if the name is in the default namespace. This is a special treatment
          * for query specific implementation, which defines a prefix for all namespace
          * URIs including the default namespace.
          *

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PropertiesSynonymProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PropertiesSynonymProvider.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PropertiesSynonymProvider.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PropertiesSynonymProvider.java
Mon May 23 15:05:40 2011
@@ -130,7 +130,7 @@ public class PropertiesSynonymProvider i
         } catch (Exception e) {
             log.error("Exception while reading synonyms", e);
         }
-        // update lastCheck timestamp, even if error occured (retry later)
+        // update lastCheck timestamp, even if error occurred (retry later)
         lastCheck = System.currentTimeMillis();
     }
 

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WeightedHighlighter.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WeightedHighlighter.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WeightedHighlighter.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WeightedHighlighter.java
Mon May 23 15:05:40 2011
@@ -65,7 +65,7 @@ public class WeightedHighlighter extends
      * @param excerptEnd    this string is appended to the excerpt
      * @param fragmentStart this string is prepended to every fragment
      * @param fragmentEnd   this string is appended to the end of every
-     *                      fragement.
+     *                      fragment.
      * @param hlStart       the string used to prepend a highlighted token, for
      *                      example <tt>&quot;&lt;b&gt;&quot;</tt>
      * @param hlEnd         the string used to append a highlighted token, for
@@ -112,6 +112,7 @@ public class WeightedHighlighter extends
                 START_HIGHLIGHT, END_HIGHLIGHT, maxFragments, surround);
     }
 
+    @Override
     protected String mergeFragments(TermVectorOffsetInfo[] offsets,
                                     String text,
                                     String excerptStart,
@@ -189,9 +190,9 @@ public class WeightedHighlighter extends
             int limit = Math.max(0, fi.getStartOffset() / 2 + fi.getEndOffset() / 2 - surround);
             int len = startFragment(sb, text, fi.getStartOffset(), limit);
             TermVectorOffsetInfo lastOffsetInfo = null;
-            Iterator fIt = fi.iterator();
+            Iterator<TermVectorOffsetInfo> fIt = fi.iterator();
             while (fIt.hasNext()) {
-                TermVectorOffsetInfo oi = (TermVectorOffsetInfo) fIt.next();
+                TermVectorOffsetInfo oi = fIt.next();
                 if (lastOffsetInfo != null) {
                     // fill in text between terms
                     sb.append(text.substring(lastOffsetInfo.getEndOffset(), oi.getStartOffset()));
@@ -345,6 +346,7 @@ public class WeightedHighlighter extends
          * is considered the lesser. This will result in a queue that keeps the
          * {@link FragmentInfo} with the best quality.
          */
+        @Override
         protected boolean lessThan(Object a, Object b) {
             FragmentInfo infoA = (FragmentInfo) a;
             FragmentInfo infoB = (FragmentInfo) b;

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ChildNodeJoinMerger.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ChildNodeJoinMerger.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ChildNodeJoinMerger.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ChildNodeJoinMerger.java
Mon May 23 15:05:40 2011
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.core.query.lucene.join;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
@@ -59,7 +60,7 @@ class ChildNodeJoinMerger extends JoinMe
     }
 
     @Override
-    public List<Constraint> getRightJoinConstraints(List<Row> leftRows)
+    public List<Constraint> getRightJoinConstraints(Collection<Row> leftRows)
             throws RepositoryException {
         Set<String> paths = new HashSet<String>();
         for (Row row : leftRows) {

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ConstraintSplitter.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ConstraintSplitter.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ConstraintSplitter.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ConstraintSplitter.java
Mon May 23 15:05:40 2011
@@ -16,10 +16,8 @@
  */
 package org.apache.jackrabbit.core.query.lucene.join;
 
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Set;
 
 import javax.jcr.RepositoryException;
@@ -45,15 +43,17 @@ import javax.jcr.query.qom.SameNode;
 import javax.jcr.query.qom.UpperCase;
 
 /**
- * Returns a mapped constraint that only refers to the given set of
- * selectors. The returned constraint is guaranteed to match an as small
- * as possible superset of the node tuples matched by the given original
- * constraints.
+ * Returns a mapped constraint that only refers to the given set of selectors.
+ * The returned constraint is guaranteed to match an as small as possible
+ * superset of the node tuples matched by the given original constraints.
  *
- * @param constraint original constraint
- * @param selectors target selectors
+ * @param constraint
+ *            original constraint
+ * @param selectors
+ *            target selectors
  * @return mapped constraint
- * @throws RepositoryException if the constraint mapping fails
+ * @throws RepositoryException
+ *             if the constraint mapping fails
  */
 class ConstraintSplitter {
 
@@ -63,39 +63,21 @@ class ConstraintSplitter {
 
     private final Set<String> rightSelectors;
 
-    private final List<Constraint> leftConstraints =
-        new ArrayList<Constraint>();
+    private final ConstraintSplitInfo constraintSplitInfo;
 
-    private final List<Constraint> rightConstraints =
-        new ArrayList<Constraint>();
-
-    public ConstraintSplitter(
-            Constraint constraint, QueryObjectModelFactory factory,
-            Set<String> leftSelectors, Set<String> rightSelectors)
-            throws RepositoryException {
+    public ConstraintSplitter(Constraint constraint,
+            QueryObjectModelFactory factory, Set<String> leftSelectors,
+            Set<String> rightSelectors) throws RepositoryException {
         this.factory = factory;
         this.leftSelectors = leftSelectors;
         this.rightSelectors = rightSelectors;
+        constraintSplitInfo = new ConstraintSplitInfo(this.factory);
 
         if (constraint != null) {
             split(constraint);
         }
     }
 
-    /**
-     * @return the left constraint
-     */
-    public Constraint getLeftConstraint() throws RepositoryException {
-        return Constraints.and(factory, leftConstraints);
-    }
-
-    /**
-     * @return the right constraint
-     */
-    public Constraint getRightConstraint() throws RepositoryException {
-        return Constraints.and(factory, rightConstraints);
-    }
-
     private void split(Constraint constraint) throws RepositoryException {
         if (constraint instanceof Not) {
             splitNot((Not) constraint);
@@ -103,24 +85,33 @@ class ConstraintSplitter {
             And and = (And) constraint;
             split(and.getConstraint1());
             split(and.getConstraint2());
+        } else if (constraint instanceof Or) {
+            if (isReferencingBothSides(getSelectorNames(constraint))) {
+                constraintSplitInfo.split((Or) constraint);
+            } else {
+                splitBySelectors(constraint, getSelectorNames(constraint));
+            }
         } else {
             splitBySelectors(constraint, getSelectorNames(constraint));
         }
     }
 
+    private boolean isReferencingBothSides(Set<String> selectors) {
+        return !leftSelectors.containsAll(selectors)
+                && !rightSelectors.containsAll(selectors);
+    }
+
     private void splitNot(Not not) throws RepositoryException {
         Constraint constraint = not.getConstraint();
         if (constraint instanceof Not) {
             split(((Not) constraint).getConstraint());
         } else if (constraint instanceof And) {
             And and = (And) constraint;
-            split(factory.or(
-                    factory.not(and.getConstraint1()),
+            split(factory.or(factory.not(and.getConstraint1()),
                     factory.not(and.getConstraint2())));
         } else if (constraint instanceof Or) {
             Or or = (Or) constraint;
-            split(factory.and(
-                    factory.not(or.getConstraint1()),
+            split(factory.and(factory.not(or.getConstraint1()),
                     factory.not(or.getConstraint2())));
         } else {
             splitBySelectors(not, getSelectorNames(constraint));
@@ -130,23 +121,24 @@ class ConstraintSplitter {
     private void splitBySelectors(Constraint constraint, Set<String> selectors)
             throws UnsupportedRepositoryOperationException {
         if (leftSelectors.containsAll(selectors)) {
-            leftConstraints.add(constraint);
+            constraintSplitInfo.addLeftConstraint(constraint);
         } else if (rightSelectors.containsAll(selectors)) {
-            rightConstraints.add(constraint);
+            constraintSplitInfo.addRightConstraint(constraint);
         } else {
             throw new UnsupportedRepositoryOperationException(
                     "Unable to split a constraint that references"
-                    + " both sides of a join: " + constraint);
+                            + " both sides of a join: " + constraint);
         }
     }
 
     /**
      * Returns the names of the selectors referenced by the given constraint.
      *
-     * @param constraint constraint
+     * @param constraint
+     *            constraint
      * @return referenced selector names
      * @throws UnsupportedRepositoryOperationException
-     *         if the constraint type is unknown
+     *             if the constraint type is unknown
      */
     private Set<String> getSelectorNames(Constraint constraint)
             throws UnsupportedRepositoryOperationException {
@@ -184,14 +176,16 @@ class ConstraintSplitter {
     }
 
     /**
-     * Returns the combined set of selector names referenced by the given
-     * two constraint.
+     * Returns the combined set of selector names referenced by the given two
+     * constraint.
      *
-     * @param a first constraint
-     * @param b second constraint
+     * @param a
+     *            first constraint
+     * @param b
+     *            second constraint
      * @return selector names
      * @throws UnsupportedRepositoryOperationException
-     *         if the constraint types are unknown
+     *             if the constraint types are unknown
      */
     private Set<String> getSelectorNames(Constraint a, Constraint b)
             throws UnsupportedRepositoryOperationException {
@@ -204,10 +198,11 @@ class ConstraintSplitter {
     /**
      * Returns the selector name referenced by the given dynamic operand.
      *
-     * @param operand dynamic operand
+     * @param operand
+     *            dynamic operand
      * @return selector name
      * @throws UnsupportedRepositoryOperationException
-     *         if the operand type is unknown
+     *             if the operand type is unknown
      */
     private String getSelectorName(DynamicOperand operand)
             throws UnsupportedRepositoryOperationException {
@@ -238,4 +233,8 @@ class ConstraintSplitter {
         }
     }
 
+    public ConstraintSplitInfo getConstraintSplitInfo() {
+        return constraintSplitInfo;
+    }
+
 }

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/DescendantNodeJoinMerger.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/DescendantNodeJoinMerger.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/DescendantNodeJoinMerger.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/DescendantNodeJoinMerger.java
Mon May 23 15:05:40 2011
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.core.query.lucene.join;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
@@ -59,7 +60,7 @@ class DescendantNodeJoinMerger extends J
     }
 
     @Override
-    public List<Constraint> getRightJoinConstraints(List<Row> leftRows)
+    public List<Constraint> getRightJoinConstraints(Collection<Row> leftRows)
             throws RepositoryException {
         Set<String> paths = new HashSet<String>();
         for (Row row : leftRows) {

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/EquiJoinMerger.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/EquiJoinMerger.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/EquiJoinMerger.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/EquiJoinMerger.java
Mon May 23 15:05:40 2011
@@ -19,6 +19,7 @@ package org.apache.jackrabbit.core.query
 import static javax.jcr.query.qom.QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -76,7 +77,7 @@ class EquiJoinMerger extends JoinMerger 
     }
 
     @Override
-    public List<Constraint> getRightJoinConstraints(List<Row> leftRows)
+    public List<Constraint> getRightJoinConstraints(Collection<Row> leftRows)
             throws RepositoryException {
         Map<String, Literal> literals = new HashMap<String, Literal>();
         for (Row leftRow : leftRows) {

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/JoinMerger.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/JoinMerger.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/JoinMerger.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/JoinMerger.java
Mon May 23 15:05:40 2011
@@ -19,6 +19,7 @@ package org.apache.jackrabbit.core.query
 import static javax.jcr.query.qom.QueryObjectModelConstants.JCR_JOIN_TYPE_LEFT_OUTER;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.LinkedHashSet;
@@ -224,7 +225,7 @@ abstract class JoinMerger {
     public abstract Set<String> getRightValues(Row row)
             throws RepositoryException;
 
-    public abstract List<Constraint> getRightJoinConstraints(List<Row> leftRows)
+    public abstract List<Constraint> getRightJoinConstraints(Collection<Row>
leftRows)
             throws RepositoryException;
 
 }

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/JoinRow.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/JoinRow.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/JoinRow.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/JoinRow.java
Mon May 23 15:05:40 2011
@@ -100,10 +100,14 @@ public class JoinRow extends AbstractRow
         for (String selector : rightSelectors) {
             builder.append(selector);
             builder.append("=");
-            try {
-                builder.append(rightRow.getNode(selector));
-            } catch (RepositoryException e) {
-                builder.append(e.getMessage());
+            if(rightRow != null){
+                try {
+                    builder.append(rightRow.getNode(selector));
+                } catch (RepositoryException e) {
+                    builder.append(e.getMessage());
+                }
+            }else{
+                builder.append("null");
             }
             builder.append(" ");
         }

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/QueryEngine.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/QueryEngine.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/QueryEngine.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/QueryEngine.java
Mon May 23 15:05:40 2011
@@ -24,9 +24,12 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
+import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -164,45 +167,98 @@ public class QueryEngine {
                 merger.getLeftSelectors(), merger.getRightSelectors());
 
         Source left = join.getLeft();
-        Constraint leftConstraint = splitter.getLeftConstraint();
-        QueryResult leftResult =
-            execute(null, left, leftConstraint, null, 0, -1);
-        List<Row> leftRows = new ArrayList<Row>();
+        Set<Row> leftRows = buildLeftRowsJoin(left, splitter.getConstraintSplitInfo());
+
+        Source right = join.getRight();
+        List<Constraint> rightConstraints = merger.getRightJoinConstraints(leftRows);
+        RowIterator rightRows = new RowIteratorAdapter(buildRightRowsJoin(right, splitter.getConstraintSplitInfo(),
rightConstraints));
+
+        QueryResult result = merger.merge(new RowIteratorAdapter(leftRows), rightRows);
+        return sort(result, orderings, offset, limit);
+    }
+
+    private Comparator<Row> buildSimplePathRowComparator() {
+        return new Comparator<Row>() {
+
+            public int compare(Row o1, Row o2) {
+                try {
+                    return o1.getPath().compareTo(o2.getPath());
+                } catch (RepositoryException e) {
+                    throw new RuntimeException("Unable to compare rows " + o1
+                            + " and " + o2, e);
+                }
+            }
+        };
+    }
+
+    private Set<Row> buildLeftRowsJoin(Source left, ConstraintSplitInfo csi)
+            throws RepositoryException {
+
+        if (csi.isMultiple()) {
+            // this *needs* to merge automatically multiple sets of nodes
+            Set<Row> leftRows = new TreeSet<Row>(buildSimplePathRowComparator());
+            for (ConstraintSplitInfo child : csi.getInnerConstraints()) {
+                leftRows.addAll(buildLeftRowsJoin(left, child));
+            }
+            return leftRows;
+        }
+
+        Set<Row> leftRows = new HashSet<Row>();
+        Constraint leftConstraint = csi.getLeftConstraint();
+        QueryResult leftResult = execute(null, left, leftConstraint, null, 0,
+                -1);
         for (Row row : JcrUtils.getRows(leftResult)) {
             leftRows.add(row);
         }
+        return leftRows;
+    }
 
-        RowIterator rightRows;
-        Source right = join.getRight();
-        List<Constraint> rightConstraints =
-            merger.getRightJoinConstraints(leftRows);
+    private Set<Row> buildRightRowsJoin(Source right, ConstraintSplitInfo csi,
+            List<Constraint> rightConstraints) throws RepositoryException {
+
+        if (csi.isMultiple()) {
+            // this *needs* to merge automatically multiple sets of nodes
+            Set<Row> rightRows = new TreeSet<Row>(
+                    buildSimplePathRowComparator());
+            for (ConstraintSplitInfo child : csi.getInnerConstraints()) {
+                rightRows.addAll(buildRightRowsJoin(right, child,
+                        rightConstraints));
+            }
+            return rightRows;
+        }
+
+        // TODO refactor to page automatically at 500 *if needed*
         if (rightConstraints.size() < 500) {
-            Constraint rightConstraint = Constraints.and(
-                    qomFactory,
+            Set<Row> rightRows = new HashSet<Row>();
+            Constraint rightConstraint = Constraints.and(qomFactory,
                     Constraints.or(qomFactory, rightConstraints),
-                    splitter.getRightConstraint());
-            rightRows =
-                execute(null, right, rightConstraint, null, 0, -1).getRows();
-        } else {
-            List<Row> list = new ArrayList<Row>();
-            for (int i = 0; i < rightConstraints.size(); i += 500) {
-                Constraint rightConstraint = Constraints.and(
-                        qomFactory,
-                        Constraints.or(qomFactory, rightConstraints.subList(
-                                i, Math.min(i + 500, rightConstraints.size()))),
-                        splitter.getRightConstraint());
-                QueryResult rigthResult =
-                    execute(null, right, rightConstraint, null, 0, -1);
-                for (Row row : JcrUtils.getRows(rigthResult)) {
-                    list.add(row);
-                }
+                    csi.getRightConstraint());
+            QueryResult rightResult = execute(null, right, rightConstraint,
+                    null, 0, -1);
+            for (Row row : JcrUtils.getRows(rightResult)) {
+                rightRows.add(row);
+            }
+            return rightRows;
+        }
+
+        Set<Row> rightRows = new HashSet<Row>();
+        for (int i = 0; i < rightConstraints.size(); i += 500) {
+            Constraint rightConstraint = Constraints
+                    .and(qomFactory,
+                            Constraints.or(
+                                    qomFactory,
+                                    rightConstraints.subList(
+                                            i,
+                                            Math.min(i + 500,
+                                                    rightConstraints.size()))),
+                            csi.getRightConstraint());
+            QueryResult rightResult = execute(null, right, rightConstraint,
+                    null, 0, -1);
+            for (Row row : JcrUtils.getRows(rightResult)) {
+                rightRows.add(row);
             }
-            rightRows = new RowIteratorAdapter(list);
         }
-
-        QueryResult result =
-            merger.merge(new RowIteratorAdapter(leftRows), rightRows);
-        return sort(result, orderings, offset, limit);
+        return rightRows;
     }
 
     protected QueryResult execute(

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/SameNodeJoinMerger.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/SameNodeJoinMerger.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/SameNodeJoinMerger.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/SameNodeJoinMerger.java
Mon May 23 15:05:40 2011
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.core.query.lucene.join;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
@@ -64,7 +65,7 @@ class SameNodeJoinMerger extends JoinMer
     }
 
     @Override
-    public List<Constraint> getRightJoinConstraints(List<Row> leftRows)
+    public List<Constraint> getRightJoinConstraints(Collection<Row> leftRows)
             throws RepositoryException {
         Set<String> paths = new HashSet<String>();
         for (Row row : leftRows) {

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ScoreNodeMap.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ScoreNodeMap.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ScoreNodeMap.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/ScoreNodeMap.java
Mon May 23 15:05:40 2011
@@ -37,11 +37,11 @@ public final class ScoreNodeMap {
     /**
      * Adds <code>scoreNodes</code> to this map under the given <code>key</code>.
      * If there already exists a mapping with the given <code>key</code> the
-     * <code>scoreNodes</code> are added to the existingmapping. The add
+     * <code>scoreNodes</code> are added to the existing mapping. The add
      * operation works as follows:
      * <ul>
      * <li>If the existing value for <code>key</code> is a <code>ScoreNode[]</code>,
-     * then the value is turned into a <code>List</code> and the exising value
+     * then the value is turned into a <code>List</code> and the existing value
      * as well as the new value are added to the <code>List</code>. Finally
      * the <code>List</code> is uses as the new value for the mapping.
      * </li>

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/JoinTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/JoinTest.java?rev=1126527&r1=1126526&r2=1126527&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/JoinTest.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/JoinTest.java
Mon May 23 15:05:40 2011
@@ -23,8 +23,7 @@ import javax.jcr.query.Query;
 import javax.jcr.query.QueryResult;
 
 /**
- * Test case for
- * <a href="https://issues.apache.org/jira/browse/JCR-2718">JCR-2718</a>
+ * Test case for JOIN queries with JCR_SQL2
  */
 public class JoinTest extends AbstractQueryTest {
 
@@ -45,8 +44,7 @@ public class JoinTest extends AbstractQu
 
         Node n3 = node.addNode("node3");
         n3.addMixin(NodeType.MIX_REFERENCEABLE);
-        n3.setProperty(
-                "testref",
+        n3.setProperty("testref",
                 new String[] { n1.getIdentifier(), n2.getIdentifier() },
                 PropertyType.REFERENCE);
         testRootNode.getSession().save();
@@ -59,12 +57,72 @@ public class JoinTest extends AbstractQu
         super.tearDown();
     }
 
+    /**
+     * Test case for <a
+     * href="https://issues.apache.org/jira/browse/JCR-2718">JCR-2718</a>
+     */
     public void testMultiValuedReferenceJoin() throws Exception {
-        String join =
-            "SELECT a.*, b.*"
-            + " FROM [nt:base] AS a"
-            + " INNER JOIN [nt:base] AS b ON a.[jcr:uuid] = b.testref";
-        QueryResult result = qm.createQuery(join, Query.JCR_SQL2).execute();
+        String join = "SELECT a.*, b.*" + " FROM [nt:base] AS a"
+                + " INNER JOIN [nt:base] AS b ON a.[jcr:uuid] = b.testref";
+        checkResult(qm.createQuery(join, Query.JCR_SQL2).execute(), 2);
+    }
+
+    /**
+     * Test case for <a
+     * href="https://issues.apache.org/jira/browse/JCR-2852">JCR-2852</a>
+     */
+    public void testJoinWithOR() throws Exception {
+
+        String join = "SELECT a.*, b.*"
+                + " FROM [nt:base] AS a"
+                + " INNER JOIN [nt:base] AS b ON a.[jcr:uuid] = b.testref WHERE "
+                + "a.[jcr:primaryType] IS NOT NULL OR b.[jcr:primaryType] IS NOT NULL";
+
+        Query q = qm.createQuery(join, Query.JCR_SQL2);
+        QueryResult result = q.execute();
+        checkResult(result, 2);
+    }
+
+    /**
+     * Test case for <a
+     * href="https://issues.apache.org/jira/browse/JCR-2852">JCR-2852</a> <br>
+     * <p>
+     * Test inspired by <a
+     * href="http://markmail.org/message/gee5yyygozestsml">this discussion</a>
+     */
+    public void testMegaJoin() throws Exception {
+
+        // WHERE
+        // ( (ISSAMENODE(projects,
+        // '/repository/projects/U970f5509-54de-46d8-88bd-bc1a94ab85eb')))
+        // AND
+        // ( ( ISDESCENDANTNODE( projects, '/repository/projects') AND
+        // eventclassassociations.active = true )
+        // or
+        // ( ISDESCENDANTNODE( projects, '/repository/template') )
+        // )
+        // AND ((NAME(parentRelationshipStatus) = 'parentRelationshipStatus'))
+
+        StringBuilder join = new StringBuilder(
+                "SELECT a.*, b.* FROM [nt:base] AS a");
+        join.append("  INNER JOIN [nt:base] AS b ON a.[jcr:uuid] = b.testref ");
+        join.append("  WHERE  ");
+        join.append("  ISSAMENODE(b, '/testroot/jointest/node3') ");
+        join.append("  AND ");
+        join.append("  ( ");
+        join.append("    ( ");
+        join.append("    ISDESCENDANTNODE(b, '/testroot/jointest') ");
+        join.append("    AND ");
+        join.append("    b.testref IS NOT NULL ");
+        join.append("    ) ");
+        join.append("    OR ");
+        join.append("    ISDESCENDANTNODE(a, '/testroot/jointest') ");
+        join.append("  ) ");
+        join.append("  AND ");
+        join.append(" (NAME(b) = 'node3') ");
+
+        Query q = qm.createQuery(join.toString(), Query.JCR_SQL2);
+        QueryResult result = q.execute();
         checkResult(result, 2);
     }
 



Mime
View raw message