Migration to Hql