title: JPA: m=Multiple criterias using entity Manager (OR clause)
body: <p>I am using JPA's(Entity Manager) Criteria query to fetch results from database. I need to put 'OR' clause between the criterias.</p>
  
  <p>My code is as below:</p>
  
  <pre><code>List&lt;Predicate&gt; criteraList = new ArrayList&lt;Predicate&gt;();
  if(user.getEid() != null){
      criteraList.add(criteriaUserCountry.like((Expression) userList.get("userCountryPK").get("user").get("eid"), "%" + user.getEid() + "%" ));
  }
  if(user.getFirstName() != null) {
      criteraList.add(criteriaUserCountry.like((Expression) userList.get("userCountryPK").get("user").get("firstName"), "%" + user.getFirstName() + "%" ));
  }
  cq.where(criteraList.toArray(new Predicate[]{}));
  TypedQuery&lt;UserCountry&gt; query = entityManager.createQuery(cq);
  </code></pre>
  
  <p>In terms of sql query, the above code inserts 'AND' between different criterias. How can an 'OR' clause be achieved using Entity Manager's criteria. </p>