AnsweredAssumed Answered

Using 5.11  native sql query, how to retrieve results

Question asked by studious on Apr 7, 2013
Latest reply on Apr 9, 2013 by trademak
I am trying to use a query using native query, this the query I am trying to use.
Select TASK_DEF_KEY_, count(*) count from ACT_HI_TASKINST where delete_reason_ = 'completed' group by TASK_DEF_KEY_;
How can I retrieve the count which is given as an alias for the no.of  tasks that is completed for a specific task definition?

List<HistoricTaskInstance> repo= historyService.createNativeHistoricTaskInstanceQuery().sql("Select TASK_DEF_KEY_, count(*) count from ACT_HI_TASKINST where delete_reason_ = 'completed' group by TASK_DEF_KEY_").list();
for(int n=0; n< repo.size(); n++)
            {
               taskName = repo.get(n).getTaskDefinitionKey();
           
                 // Want to retrieve count, not sure how to
                                      }

Outcomes