chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r1095713 - in /chemistry/opencmis/trunk/chemistry-opencmis-server: chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/ chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/...
Date Thu, 21 Apr 2011 14:01:41 GMT
Author: fguillaume
Date: Thu Apr 21 14:01:40 2011
New Revision: 1095713

URL: http://svn.apache.org/viewvc?rev=1095713&view=rev
Log:
Rename ColumnReference#getTypeQueryName to #getQualifier for consistency

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryParseTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/ColumnReference.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/QueryObject.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryParseTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryParseTest.java?rev=1095713&r1=1095712&r2=1095713&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryParseTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryParseTest.java
Thu Apr 21 14:01:40 2011
@@ -111,7 +111,7 @@ public class QueryParseTest extends Abst
         assertTrue(selects.get(0) instanceof ColumnReference);
 
         ColumnReference colRef = ((ColumnReference)selects.get(0));
-        assertEquals("t1", colRef.getTypeQueryName());
+        assertEquals("t1", colRef.getQualifier());
         assertEquals("abc", colRef.getPropertyQueryName());
     }
 
@@ -128,7 +128,7 @@ public class QueryParseTest extends Abst
 
         ColumnReference colRef = ((ColumnReference)selects.get(0));
         assertTrue(selects.get(0) instanceof ColumnReference);
-        assertEquals(null, colRef.getTypeQueryName());
+        assertEquals(null, colRef.getQualifier());
         assertEquals("*", colRef.getPropertyQueryName());
     }
 
@@ -145,7 +145,7 @@ public class QueryParseTest extends Abst
         assertTrue(selects.get(0) instanceof ColumnReference);
 
         ColumnReference colRef = ((ColumnReference)selects.get(0));
-        assertEquals("t1", colRef.getTypeQueryName());
+        assertEquals("t1", colRef.getQualifier());
         assertEquals("*", colRef.getPropertyQueryName());
     }
 
@@ -162,7 +162,7 @@ public class QueryParseTest extends Abst
         assertTrue(selects.get(0) instanceof ColumnReference);
 
         ColumnReference colRef = ((ColumnReference)selects.get(0));
-        assertEquals("t2", colRef.getTypeQueryName());
+        assertEquals("t2", colRef.getQualifier());
         assertEquals("aaa", colRef.getPropertyQueryName());
     }
 
@@ -304,7 +304,7 @@ public class QueryParseTest extends Abst
 
         CmisSelector sortSpec = sp.getSelector();
         assert(sortSpec instanceof ColumnReference);
-        assertEquals("abc", ((ColumnReference)sortSpec).getTypeQueryName());
+        assertEquals("abc", ((ColumnReference)sortSpec).getQualifier());
         assertEquals("def", ((ColumnReference)sortSpec).getPropertyQueryName());
     }
 
@@ -322,7 +322,7 @@ public class QueryParseTest extends Abst
 
         CmisSelector sortSpec = sp.getSelector();
         assert(sortSpec instanceof ColumnReference);
-        assertNull(((ColumnReference)sortSpec).getTypeQueryName());
+        assertNull(((ColumnReference)sortSpec).getQualifier());
         assertEquals("def", ((ColumnReference)sortSpec).getPropertyQueryName());
     }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/ColumnReference.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/ColumnReference.java?rev=1095713&r1=1095712&r2=1095713&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/ColumnReference.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/ColumnReference.java
Thu Apr 21 14:01:40 2011
@@ -23,25 +23,31 @@ import org.apache.chemistry.opencmis.com
 
 public class ColumnReference extends CmisSelector {
 
-    private final String typeQueryName;  // type query name coming from query statement
+    private final String qualifier;      // type qualifier coming from query statement
     private final String propQueryName;  // property query name coming from query statement
 
     // The following fields are set when the types are resolved:
     private String propertyId;
     private TypeDefinition typeDef;
 
-    public ColumnReference(String typeQueryName, String propQueryName) {
-        this.typeQueryName = typeQueryName;
+    public ColumnReference(String qualifier, String propQueryName) {
+        this.qualifier = qualifier;
         this.propQueryName = propQueryName;
     }
 
     public ColumnReference(String propQueryName) {
-        this.typeQueryName = null;
+        this.qualifier = null;
         this.propQueryName = propQueryName;
     }
 
+    public String getQualifier() {
+        return qualifier;
+    }
+
+    /** @deprecated use {@link #getQualifier} instead. */
+    @Deprecated
     public String getTypeQueryName() {
-        return typeQueryName;
+        return getQualifier();
     }
 
     public String getPropertyQueryName() {
@@ -73,7 +79,7 @@ public class ColumnReference extends Cmi
     @Override
     public String toString() {
         return "ColumnReference("
-                + (typeQueryName == null ? "" : typeQueryName + ".")
+                + (qualifier == null ? "" : qualifier + ".")
                 + propQueryName + (aliasName == null ? "" : " AS " + aliasName)
                 + ")";
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/QueryObject.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/QueryObject.java?rev=1095713&r1=1095712&r2=1095713&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/QueryObject.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/QueryObject.java
Thu Apr 21 14:01:40 2011
@@ -68,7 +68,7 @@ public class QueryObject {
 
     // order by part
     protected final List<SortSpec> sortSpecs = new ArrayList<SortSpec>();
-    
+
     private String errorMessage;
 
     public static class JoinSpec {
@@ -133,7 +133,7 @@ public class QueryObject {
     public CmisSelector getColumnReference(Integer token) {
         return columnReferences.get(token);
     }
-    
+
     public String getErrorMessage() {
         return errorMessage;
     }
@@ -379,7 +379,7 @@ public class QueryObject {
                 if (select instanceof ColumnReference) {
                     ColumnReference colRef = ((ColumnReference) select);
                     if (colRef.getTypeDefinition() == null) { // not yet resolved
-                        if (colRef.getTypeQueryName() == null) {
+                        if (colRef.getQualifier() == null) {
                             // unqualified select: SELECT p FROM
                             resolveTypeForColumnReference(colRef);
                         } else {
@@ -389,7 +389,7 @@ public class QueryObject {
                     }
                 }
             }
-            
+
             return true;
         } catch (CmisQueryException cqe) {
             errorMessage = cqe.getMessage(); // preserve message
@@ -404,7 +404,7 @@ public class QueryObject {
             CmisSelector selector = colOrFuncAlias.get(aliasName);
             if (selector instanceof ColumnReference) {
                 colRef = (ColumnReference) selector; // alias target
-                if (colRef.getTypeQueryName() == null) {
+                if (colRef.getQualifier() == null) {
                     // unqualified select: SELECT p FROM
                     resolveTypeForColumnReference(colRef);
                 } else {
@@ -452,10 +452,10 @@ public class QueryObject {
     // from
     protected void validateColumnReferenceAndResolveType(ColumnReference colRef) {
         // either same name or mapped alias
-        String typeQueryName = getReferencedTypeQueryName(colRef.getTypeQueryName());
+        String typeQueryName = getReferencedTypeQueryName(colRef.getQualifier());
         TypeDefinition td = typeMgr.getTypeByQueryName(typeQueryName);
         if (null == td)
-            throw new CmisQueryException(colRef.getTypeQueryName()
+            throw new CmisQueryException(colRef.getQualifier()
                     + " is neither a type query name nor an alias.");
 
         validateColumnReferenceAndResolveType(td, colRef);



Mime
View raw message