AnsweredAssumed Answered

taskService.createTaskQuery().orderByExecutionId().desc().list() -invalid query getting created

Question asked by devesh on Jan 10, 2016
Latest reply on Jan 21, 2016 by devesh
Activiti Engine : 5.19.0

Usage : taskService.createTaskQuery().orderByExecutionId().desc().list()  ;

Database MySQL :

Logs :
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by RES.EXECUTION_ID_ desc 
    LIMIT 2147483647 OFFSET 0' at line 15
### The error may exist in org/activiti/db/mapping/entity/Task.xml
### The error may involve org.activiti.engine.impl.persistence.entity.TaskEntity.selectTaskByQueryCriteria-Inline
### The error occurred while setting parameters
### SQL: select distinct RES.*              from ACT_RU_TASK RES                                                                     order by  order by RES.EXECUTION_ID_ desc       LIMIT ? OFFSET ?
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by RES.EXECUTION_ID_ desc 
    LIMIT 2147483647 OFFSET 0' at line 15
   at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:122)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:113)
   at org.activiti.engine.impl.db.DbSqlSession.selectListWithRawParameter(DbSqlSession.java:436)
   at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:427)
   at org.activiti.engine.impl.persistence.entity.TaskEntityManager.findTasksByQueryCriteria(TaskEntityManager.java:135)
   at org.activiti.engine.impl.TaskQueryImpl.executeList(TaskQueryImpl.java:1230)
   at org.activiti.engine.impl.AbstractQuery.execute(AbstractQuery.java:164)
   at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)

Outcomes