Implement Hibernate with domain classes and HQL