AnsweredAssumed Answered

"=" and "IN" operators doesn't work in CMIS query

Question asked by aminebarbare on Oct 7, 2016
Latest reply on Oct 13, 2016 by aminebarbare

Hi guys,

I defined an aspect where the "typeDocument" property is defined :

 

<?xml version="1.0" encoding="UTF-8"?>
<!-- Definition of new Model -->
<model name="idoc:ideodocModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

<!-- Optional meta-data about the model -->
<description>IdeoDoc Model</description>
<author>MERIEM BENSAID</author>
<version>1.0</version>

<!-- Imports are required to allow references to definitions in other models -->
<imports>
<!-- Import Alfresco Dictionary Definitions -->
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
<!-- Import Alfresco Content Domain Model Definitions -->
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />

</imports>
<namespaces>
<namespace uri="http://sante.documentaire.sqli.com/model/content/1.0" prefix="idoc" />
</namespaces>
<aspects>
<aspect name="idoc:typeDocument">
<title>Type du document</title>
<properties>
<property name="idoc:idTypedocument">
<title>identifiant du type</title>
<type>d:text</type>
<multiple>false</multiple>
</property>
<property name="idoc:libelleTypeDocument">
<title>Libellé du type</title>
<type>d:text</type>
<multiple>false</multiple>
</property>
</properties>
</aspect>
</aspects>
</model>

 

So I'm trying to execute the following query to get documents with "idTypedocument" equals to 9, but this query gets nothing.

SELECT * FROM vig:content content JOIN idoc:typeDocument typeDoc ON content.cmis:objectId = typeDoc.cmis:objectId WHERE content.cmis:objectId is not null  AND typeDoc.idoc:idTypedocument = '9'

However when i execute tthe following query I get the results I want.

SELECT * FROM vig:content content JOIN idoc:typeDocument typeDoc ON content.cmis:objectId = typeDoc.cmis:objectId WHERE content.cmis:objectId is not null  AND typeDoc.idoc:idTypedocument <= '9' AND typeDoc.idoc:idTypedocument >= '9'

The problem is that i'm only replacing the "=" operator with "<= AND >=" operators.
The type of the "idTypedocument" attribute is String and i'm using the version : (Version :Community - v4.2.0 (r63893-b12))

So am I forgetting something in the aspect/property definition?

Thanks in advance.

PS: the same problem with "IN" operator.

Outcomes