Implement Criteria API to use with HQL queries