Making JPA criteria easier
Latest commit e2d42b7 Nov 12, 2014 @uaihebert Adding maven badge
Failed to load latest commit information.
src Adding a test Oct 21, 2014
.gitignore adding gititnor Oct 16, 2014
.travis.yml fixing travis config Oct 16, 2014 Adding maven badge Nov 12, 2014
metaModel.txt first import of the new version Oct 16, 2014
pom.xml Creating new version Nov 3, 2014
todo.txt adding todo Oct 21, 2014


How can JPA criteria became easier?

CodeStatus ---> Build Status Coverage Status Maven Central

Yes, your JPA Criteria can be easy. All you need to do is to add uaiCriteria in your implementation.

Imagine that you want to run the following JPQL:

select p from Person p 

If you want do write the JPQL above using only the JPA native Criteira, you should do something like:

 CriteriaQuery<Person> criteriaQuery = criteriaBuilder.createQuery(Person.class);
 Root<Person> root = criteriaQuery.from(Person.class);;
 TypedQuery<Person> query = entityManager.createQuery(criteriaQuery);

With uaiCriteria you could run like this:

UaiCriteria<Person> easyCriteria = UaiCriteriaFactory.createQueryCriteria(entityManager, Person.class);

To create a code like the code above, add the maven dependency below:


Now, criteria is easy to use! ;)

You have the following mvn commands available:

  • if you want to build the project run: mvn clean package
  • if you want to test the project run: mvn clean test
  • if you want to generate the cobertura report use: mvn cobertura:clean cobertura:cobertura
    • the generated report can be found at: <uaiCriteria_FOLDER>/target/site/cobertura/index.html
  • if you have a sonar server you will be able to create a report by doing mvn sonar:sonar