title: HQL query with enums
body: <p>I'm trying to make this query work, in my model Workshop I have a enum type field where it connects to roles. </p>
  
  <p>I kinda have never used HQL to do this, only simple HQL queries, I know it's really powerful and simplifies a lot of things but whenever I try to create a query to match the enumerated role it either throws a message about "dereference". </p>
  
  <p>The models corresponding this query is </p>
  
  <ul>
  <li>AccountRoles (enum class) </li>
  <li>Workshop (annotated class)</li>
  <li>Account (annotated class)  </li>
  </ul>
  
  <p>.</p>
  
  <pre><code>NamedQuery(name="namedOne", 
      query="from Workshop s inner join Account a where a.account_role = :role"
  </code></pre>
  
  <p>I have tried this one query which is probably wrong, another one like this</p>
  
  <pre><code>NamedQuery(name="namedOne", query="from Workshop accounts.account_role = :role"
  </code></pre>
  
  <p>The field accounts contains </p>
  
  <pre><code>@OneToMany(fetch=FetchType.EAGER)
  @JoinTable(name="links_ws2accounts")
  public List&lt;models.ws.Account&gt; accounts = new ArrayList&lt;models.ws.Account&gt;();
  </code></pre>
  
  <p>Any suggestion is appreciated, if you need a bit more info let me know</p>