title: JPA Criteria api using IN expression with join
body: <p>i have entity <code>Request</code> that have <code>@ManyToMany Set&lt;Region&gt; regions</code>, and <code>Region</code> entity have field <code>region</code> of type <code>RegionEnum</code> of enum type with constants of regions.
  I need to create criteria to get requests, where its regions are in collection of RegionEnum;
  In my choice:</p>
  
  <pre><code>List&lt;RegionEnum&gt; regs=...; // from method parameter
  CriteriaBuilder cb=em.getCriteriaBuilder();
  CriteriaQuery&lt;Request&gt; cq=cb.createQuery(Request.class);
  
  Root&lt;Request&gt; from=cq.from(Request.class);
  cq.where(cb.isTrue(from.join("regions").get("region").in(regs)));
  return em.createQuery(cq).getResultList();
  </code></pre>
  
  <p>I have an <code>java.lang.IllegalArgumentException: PREDICATE_PASSED_TO_EVALUATION (There is no English translation for this message.)</code></p>
  
  <p>enum:</p>
  
  <pre><code>public enum RegionEnum {
  CENTRAL("Центральный"),
  SOUTH("Южный"),
  NWEST("Северо-Западный"),
  FEAST("Дальневосточный"),
  SIB("Сибирский"),
  URFO("Уральский"),
  VOLGA("Волжский"),
  NCAU("Северо-Кавказский");
  
  
  private final String value;
  
  private Region(String value) {
      this.value=value;
  }
  
  public String value() {
      return this.value;
  }
  
  }
  </code></pre>
  
  <p>is my criteria right and problem with enum? or criteria is bad?</p>