title: Hibernate Criteria Enum
body: <p>if you have a Enum in your entities like this:</p>
  
  <pre><code>@Entity
  public class AA{
      @Embedded
      public BB b;
  ...
  }
  
  @Embeddable
  public class BB{
      @Enumerated(EnumType.STRING)
      @Column(columnDefinition = "varchar(50)")
      private CC c;
      ...
  }
  
  public enum CC{
      D("DDD","123"),
      E("EEE","456");
  }
  </code></pre>
  
  <p>then use hibernate criteria query like this:</p>
  
  <pre><code>Criteria crit = sessionFactory.getCurrentSession().createCriteria(AA.class);
  List&lt;AA&gt; list = crit.add(Restrictions.eq("b.c", CC.D)).list();
  </code></pre>