title: hibernate jpa criteriabuilder ignore case queries
body: <p>How to do a like ignore case query using criteria builder. For description property I want to do something like <code>upper(description) like '%xyz%'</code></p>
  
  <p>I have the following query</p>
  
  <pre><code>CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
  
      CriteriaQuery&lt;Person&gt; personCriteriaQuery = criteriaBuilder.createQuery(Person.class);
      Root&lt;Person&gt; personRoot = personCriteriaQuery.from(Person.class);
  
      personCriteriaQuery.select(personRoot);
      personCriteriaQuery.where(criteriaBuilder.like(personRoot.get(Person_.description), "%"+filter.getDescription().toUpperCase()+"%"));
      List&lt;Person&gt; pageResults = entityManager.createQuery(personCriteriaQuery).getResultList();
  </code></pre>