For a "how to", tutorial or the JAR you can find the in project page
http://easycriteria.uaihebert.com/
This project purpose is to help the developer to use the JPA criteria.
Imagine the JPQL bellow:
select p from Person p
A JPA Criteria to do the JPQL above would be:
CriteriaQuery
criteriaQuery = criteriaBuilder.createQuery(Person.class);Root root = criteriaQuery.from(Person.class);criteriaQuery.select(root);TypedQuery query = entityManager.createQuery(criteriaQuery);query.getResultList();
With EasyCriteria will be:
EasyCriteria easyCriteria = EasyCriteriaFactory.createQuery(entityManager, Person.class);easyCriteria.getResultList();
We are using JUnit with the Cobertura Plugin to measure the coverage of the EasyCriteria library. So far we have 100% of test coverage. [=
To use it with Maven just add the depen