A java criteria api where path expressions are constructed by invoking methods on a proxy for an entity-class (supports both JPA and Hibernate).
ProxyQuery<Customer> query = queryFactory.createQuery(Customer.class);
Customer customer = query.getRootProxy();
query.andWhere(customer.getFirstName()).equalTo("John");
List<Customer> results = query.find();
--produces the following hql/jpql:
SELECT a FROM Customer a WHERE a.firstName = 'John'