title: Play! JPA - Get an enum value in a query
body: <p>This is my enum :</p>
  
  <pre><code>package enums;
  
  public enum SessionType {
      SESSION_NORMAL(12), SESSION_PERFECT(5), SESSION_SOLO(1);
  
      private int value;
  
      private SessionType(int value) {
          this.setValue(value);
      }
  
      public void setValue(int value) {
          this.value = value;
      }
  
      public int getValue() {
          return value;
      }
  
      public String toString(){
          return this.name();
      }
  
  }
  </code></pre>
  
  <p>I've got a models class Session with an attribut type :</p>
  
  <pre><code>@Required
  @Enumerated(EnumType.STRING)
  @Column(name="type")
  private SessionType type;
  </code></pre>
  
  <p>And I would like to do a query like that :</p>
  
  <pre><code>Session.find("type.value = 1");
  </code></pre>
  
  <p>Regards.</p>