jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r770713 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene: JoinQuery.java LuceneQueryFactoryImpl.java join/Join.java
Date Fri, 01 May 2009 15:32:28 GMT
Author: jukka
Date: Fri May  1 15:32:27 2009
New Revision: 770713

URL: http://svn.apache.org/viewvc?rev=770713&view=rev
Log:
JCR-2095: Use an enumeration for QOM join types

Use the new JoinType enumeration in -core

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JoinQuery.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryFactoryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/Join.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JoinQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JoinQuery.java?rev=770713&r1=770712&r2=770713&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JoinQuery.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JoinQuery.java
Fri May  1 15:32:27 2009
@@ -24,6 +24,7 @@
 import org.apache.jackrabbit.core.query.lucene.join.Join;
 import org.apache.jackrabbit.core.HierarchyManager;
 import org.apache.jackrabbit.spi.commons.query.qom.JoinConditionImpl;
+import org.apache.jackrabbit.spi.commons.query.qom.JoinType;
 
 /**
  * <code>JoinQuery</code> implements a query that performs a join.
@@ -43,7 +44,7 @@
     /**
      * The join type.
      */
-    private final String joinType;
+    private final JoinType joinType;
 
     /**
      * The QOM join condition.
@@ -72,7 +73,7 @@
      */
     public JoinQuery(MultiColumnQuery left,
                      MultiColumnQuery right,
-                     String joinType,
+                     JoinType joinType,
                      JoinConditionImpl joinCondition,
                      SortComparatorSource scs,
                      HierarchyManager hmgr) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryFactoryImpl.java?rev=770713&r1=770712&r2=770713&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryFactoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryFactoryImpl.java
Fri May  1 15:32:27 2009
@@ -250,7 +250,7 @@
     public MultiColumnQuery create(JoinImpl join) throws RepositoryException {
         MultiColumnQuery left = create((SourceImpl) join.getLeft());
         MultiColumnQuery right = create((SourceImpl) join.getRight());
-        return new JoinQuery(left, right, join.getJoinType(),
+        return new JoinQuery(left, right, join.getJoinTypeInstance(),
                 (JoinConditionImpl) join.getJoinCondition(), scs, hmgr);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/Join.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/Join.java?rev=770713&r1=770712&r2=770713&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/Join.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/Join.java
Fri May  1 15:32:27 2009
@@ -33,6 +33,7 @@
 import org.apache.jackrabbit.spi.commons.query.qom.DescendantNodeJoinConditionImpl;
 import org.apache.jackrabbit.spi.commons.query.qom.EquiJoinConditionImpl;
 import org.apache.jackrabbit.spi.commons.query.qom.ChildNodeJoinConditionImpl;
+import org.apache.jackrabbit.spi.commons.query.qom.JoinType;
 import org.apache.jackrabbit.spi.commons.query.qom.SameNodeJoinConditionImpl;
 import org.apache.lucene.search.SortComparatorSource;
 import org.apache.lucene.index.IndexReader;
@@ -120,7 +121,7 @@
      */
     public static Join create(final MultiColumnQueryHits left,
                               final MultiColumnQueryHits right,
-                              final String joinType,
+                              final JoinType joinType,
                               final JoinConditionImpl condition,
                               final IndexReader reader,
                               final HierarchyResolver resolver,
@@ -130,8 +131,7 @@
         try {
             return (Join) condition.accept(new DefaultQOMTreeVisitor() {
 
-                private boolean isInner =
-                    JCR_JOIN_TYPE_INNER.equals(joinType);
+                private boolean isInner = JoinType.INNER == joinType;
                 private MultiColumnQueryHits outer;
                 private int outerIdx;
 
@@ -140,10 +140,9 @@
                     MultiColumnQueryHits ancestor = getSourceWithName(node.getAncestorSelectorQName(),
left, right);
                     MultiColumnQueryHits descendant = getSourceWithName(node.getDescendantSelectorQName(),
left, right);
                     Condition c;
-                    if (isInner || descendant == left
-                            && JCR_JOIN_TYPE_LEFT_OUTER.equals(joinType)
-                            || descendant == right
-                            && JCR_JOIN_TYPE_RIGHT_OUTER.equals(joinType)) {
+                    if (isInner
+                            || descendant == left && JoinType.LEFT == joinType
+                            || descendant == right && JoinType.RIGHT == joinType)
{
                         // also applies to inner join
                         // assumption: DescendantNodeJoin is more
                         // efficient than AncestorNodeJoin, TODO: verify



Mime
View raw message