Merged 5.2.N (5.2.1) to HEAD (5.2)

128217 adavis: Merged 5.1.N (5.1.2) to 5.2.N (5.2.1)
      128209 ahind: Fix for     MNT-16387   No results are returned for a CMIS query which contains IS NULL for documents with a NULL property


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@129280 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alexandru Epure
2016-08-09 13:52:24 +00:00
parent 86accb3901
commit 813abfd4bc
2 changed files with 24 additions and 2 deletions

View File

@@ -72,11 +72,18 @@
<choose> <choose>
<when test="item.joinCommandType == 'NODE'"> <when test="item.joinCommandType == 'NODE'">
( (
</when>
<otherwise>
<choose>
<when test="item.type == 'NOTEXISTS'">
node.id NOT IN (
</when> </when>
<otherwise> <otherwise>
node.id IN ( node.id IN (
</otherwise> </otherwise>
</choose> </choose>
</otherwise>
</choose>
<choose> <choose>
<when test="item.joinCommandType == 'PARENT'"> <when test="item.joinCommandType == 'PARENT'">
@@ -108,7 +115,7 @@
${item.alias}.${item.fieldName} IS NOT NULL ${item.alias}.${item.fieldName} IS NOT NULL
</when> </when>
<when test="item.type == 'NOTEXISTS'"> <when test="item.type == 'NOTEXISTS'">
${item.alias}.${item.fieldName} IS NULL ${item.alias}.${item.fieldName} IS NOT NULL
</when> </when>
<when test="item.type == 'GT'"> <when test="item.type == 'GT'">
${item.fieldAndFunction} &gt; #{item.value} ${item.fieldAndFunction} &gt; #{item.value}

View File

@@ -5739,6 +5739,21 @@ public class OpenCmisQueryTest extends BaseCMISTest
testExtendedQuery("SELECT * FROM cm:ownable ", 1, false, "cmis:name", new String(), false); testExtendedQuery("SELECT * FROM cm:ownable ", 1, false, "cmis:name", new String(), false);
} }
public void testTitled() throws Exception
{
testExtendedQuery("SELECT * FROM cm:titled where cm:title is null ", 0, false, "cmis:name", new String(), false);
testExtendedQuery("SELECT * FROM cm:titled where cm:title is not null ", 11, false, "cmis:name", new String(), false);
nodeService.setProperty(c10, ContentModel.PROP_TITLE, null);
testExtendedQuery("SELECT * FROM cm:titled where cm:title is null ", 1, false, "cmis:name", new String(), false);
testExtendedQuery("SELECT * FROM cm:titled where cm:title is not null ", 10, false, "cmis:name", new String(), false);
nodeService.setProperty(c10, ContentModel.PROP_TITLE, "meep");
testExtendedQuery("SELECT * FROM cm:titled where cm:title is null ", 0, false, "cmis:name", new String(), false);
testExtendedQuery("SELECT * FROM cm:titled where cm:title is not null ", 11, false, "cmis:name", new String(), false);
nodeService.removeProperty(c10, ContentModel.PROP_TITLE);
testExtendedQuery("SELECT * FROM cm:titled where cm:title is null ", 1, false, "cmis:name", new String(), false);
testExtendedQuery("SELECT * FROM cm:titled where cm:title is not null ", 10, false, "cmis:name", new String(), false);
}
public void testNotKeyword() throws Exception public void testNotKeyword() throws Exception
{ {
final String folderName = "testfolder" + GUID.generate(); final String folderName = "testfolder" + GUID.generate();