KHRES-348 #comment add a quick hack to use HQL when we need complex relational queries
update version