title: JPA Like Clause not working
body: <p>I try the following, but the LIKE filter is not applied, i.e. it returns the full result set. Any ideas please? As you can see in the logs below, the LIKE criteria is there, but I guess the parameters are not populated.</p>
  
  <pre><code>    CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
      CriteriaQuery&lt;T&gt; criteriaQuery = criteriaBuilder.createQuery(typeParameterClass);
  
      // from
      Root&lt;T&gt; from = criteriaQuery.from(typeParameterClass);
      criteriaQuery.select(from);
  
      // like
      if (searchQuery != null &amp;&amp; searchQuery.trim().length() &gt; 0) {
          List&lt;Predicate&gt; predicates = new ArrayList&lt;Predicate&gt;();
          for (String name : getColumnNames(typeParameterClass)) {
              Predicate condition = criteriaBuilder.like(from.&lt;String&gt;get(name), "%" + searchQuery + "%");
              predicates.add(condition);
          }
          criteriaQuery.where(criteriaBuilder.or(predicates.toArray(new Predicate[] {})));
      }
  
      List&lt;T&gt; results = (List&lt;T&gt;) entityManager.createQuery(criteriaQuery).setFirstResult(firstResult)
              .setMaxResults(maxResults).getResultList();
      return results;
  </code></pre>
  
  <p>Logs:</p>
  
  <pre><code>select
  employee0_.id as id1_1_,
  employee0_.AVATAR as AVATAR2_1_,
  employee0_.AVERAGE_RATING as AVERAGE_3_1_,
  employee0_.DISTANCE as DISTANCE4_1_,
  employee0_.DRIVERS_LICENCE as DRIVERS_5_1_,
  employee0_.EMAIL_ADDRESS as EMAIL_AD6_1_,
  employee0_.FIRST_NAME as FIRST_NA7_1_,
  employee0_.JOB_DESCRIPTION as JOB_DESC8_1_,
  employee0_.JOB_DETAILS as JOB_DETA9_1_,
  employee0_.JOB_TITLE as JOB_TIT10_1_,
  employee0_.JOINING_DATE as JOINING11_1_,
  employee0_.LASTACCESS_DATE as LASTACC12_1_,
  employee0_.LAST_NAME as LAST_NA13_1_,
  employee0_.MOBILE_NUMBER as MOBILE_14_1_,
  employee0_.PASSWORD as PASSWOR15_1_,
  employee0_.PHONE_NUMBER as PHONE_N16_1_,
  employee0_.SALARY as SALARY17_1_,
  employee0_.SALARY_TIMEFRAME as SALARY_18_1_,
  employee0_.SEX as SEX19_1_,
  employee0_.USERNAME as USERNAM20_1_,
  employee0_.WORK_LAT1 as WORK_LA21_1_,
  employee0_.WORK_LAT2 as WORK_LA22_1_,
  employee0_.WORK_LAT3 as WORK_LA23_1_,
  employee0_.WORK_LAT4 as WORK_LA24_1_,
  employee0_.WORK_LAT5 as WORK_LA25_1_,
  employee0_.WORK_LONG1 as WORK_LO26_1_,
  employee0_.WORK_LONG2 as WORK_LO27_1_,
  employee0_.WORK_LONG3 as WORK_LO28_1_,
  employee0_.WORK_LONG4 as WORK_LO29_1_,
  employee0_.WORK_LONG5 as WORK_LO30_1_ 
  11:36:53,974 INFO  [stdout] (default task-2)     from
  employee employee0_ 
  11:36:53,974 INFO  [stdout] (default task-2)     where
  employee0_.FIRST_NAME like ? 
  or employee0_.LAST_NAME like ? 
  or employee0_.PASSWORD like ? 
  or employee0_.EMAIL_ADDRESS like ? 
  or employee0_.PHONE_NUMBER like ? 
  or employee0_.MOBILE_NUMBER like ? 
  or employee0_.JOB_TITLE like ? 
  or employee0_.JOB_DESCRIPTION like ? 
  or employee0_.USERNAME like ? 
  or employee0_.JOB_DETAILS like ? 
  </code></pre>