CLSN-1593 : move queries to hql