Author: jens
Date: Fri Mar 24 15:48:12 2017
New Revision: 1788487
URL: http://svn.apache.org/viewvc?rev=1788487&view=rev
Log:
InMemory: fix join type for secondary type queries
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/EvalQueryTest.java
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java?rev=1788487&r1=1788486&r2=1788487&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java
Fri Mar 24 15:48:12 2017
@@ -819,14 +819,7 @@ public class InMemoryQueryProcessor {
List<JoinSpec> joins = queryObj.getJoins();
if (null == secondaryTypeIds && joins.size() > 0) {
throw new CmisInvalidArgumentException(
- "JOINs are not supported with the exception of secondary
types and a LEFT OUTER JOIN");
- } else if (null != secondaryTypeIds) {
- for (JoinSpec join : joins) {
- if (!join.kind.equals("LEFT")) {
- throw new CmisInvalidArgumentException(
- "JOINs are not supported with the exception of
secondary types and a LEFT OUTER JOIN");
- }
- }
+ "JOINs are not supported with the exception of secondary
types");
}
}
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/EvalQueryTest.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/EvalQueryTest.java?rev=1788487&r1=1788486&r2=1788487&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/EvalQueryTest.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/EvalQueryTest.java
Fri Mar 24 15:48:12 2017
@@ -1077,7 +1077,7 @@ public class EvalQueryTest extends Abstr
log.debug("Start testSecondaryJoin...");
// create documents with secondary types in addition
dataCreator.createSecondaryTestDocuments();
- String statement = "SELECT * FROM " + COMPLEX_TYPE + " LEFT JOIN " +
SECONDARY_TYPE + " ON " + COMPLEX_TYPE
+ String statement = "SELECT * FROM " + COMPLEX_TYPE + " JOIN " +
SECONDARY_TYPE + " ON " + COMPLEX_TYPE
+ ".cmis:objectId = " + SECONDARY_TYPE + ".cmis:objectId WHERE
cmis:name LIKE 'docwithsecondary%'";
ObjectList res = doQuery(statement);
assertEquals(2, res.getObjects().size());
@@ -1090,7 +1090,7 @@ public class EvalQueryTest extends Abstr
// Test a query with secondary types matching only one document not
// having this secondary type
- statement = "SELECT * FROM " + COMPLEX_TYPE + " LEFT JOIN " +
SECONDARY_TYPE + " ON " + COMPLEX_TYPE
+ statement = "SELECT * FROM " + COMPLEX_TYPE + " JOIN " +
SECONDARY_TYPE + " ON " + COMPLEX_TYPE
+ ".cmis:objectId = " + SECONDARY_TYPE + ".cmis:objectId WHERE
cmis:name = 'alpha'";
res = doQuery(statement);
assertEquals(1, res.getObjects().size());