switch to hibernate with jpa and hql queries