title: How can I access enum atributes in HQL?
body: <p>I have an Enum like this:</p>
  
  <pre><code>TicketPriority {
  
  LOW(4),
  NORMAL(3),
  HIGH(2),
  IMMEDIATE(1);
  
  private Integer index;
  
  TicketPriority (Integer index){
      this.index = index;
  }
  
  public Integer getIndex(){
      return this.index;
  }
  
  public void setIndex(Integer index){
      this.index = index;
  }
  }
  </code></pre>
  
  <p>... and I have an Ticket entity that has a priority. The problem: I need to order my results by priority so I thought that this would work, but it didn't:</p>
  
  <pre><code>select t from Ticket t order by t.priority.index
  </code></pre>
  
  <p>I got an error from Hibernate. Any idea besides create Priority as an entity?</p>
  
  <p>Thanks for any suggestion! :)</p>