AnsweredAssumed Answered

Ordering is not support for my:property

Question asked by iruizdeeguilaz on Feb 26, 2014
Latest reply on Feb 26, 2014 by iruizdeeguilaz

I have a problem using ORDER BY with my custom properties. I need help in orther to know what I should change in muy model to allow the order by…

I am able to do queries, and to use my aspect properties in the select…


StringBuffer cadena = new StringBuffer();
cadena.append( "SELECT * FROM my:customtype  as t join my:customaspect as d on d.cmis:objectId = t.cmis:objectId where = TIMESTAMP '"+myDate+"T00:00:00.000-00:00' ");
ItemIterable<QueryResult> results = session.query(cadena.toString(), false);
for (QueryResult qResult : results.skipTo(10).getPage(10)) {

But when I add a order by id doesn't work…. it works if i try it against for example t.cmis:name but it diesn't work againts…..

Looking up on the Internet I fond that it is necesary tu put in the model something like this (but I put it after having the documents added on the repository)

<index enabled="true">

I have added it on my model :

<?xml version="1.0" encoding="UTF-8"?>
<model name="my:model" xmlns="">
   <description>my model</description>
      <import uri="" prefix="d" />
      <import uri="" prefix="cm" />
      <namespace  uri="dynamic.model" prefix="my" />
      <type name="my:document">
         <title>my Document</title>
      <type name="my:customtype">
         <title>my type</title>
<aspect name="my:customaspect">
         <title>my Data</title>
            <property name="my:title">
               <index enabled="true">
            <property name="my:dateDocument">
               <index enabled="true">

this is the error

Exception in thread "main" org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: Ordering is not support for
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl.query(
   at org.apache.chemistry.opencmis.client.runtime.SessionImpl$3.fetchPage(
   at org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurrentPage(
   at org.apache.chemistry.opencmis.client.runtime.util.CollectionPageIterator.hasNext(