HQL query with enums
I'm trying to make this query work, in my model Workshop I have a enum type field where it connects to roles. 

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". 

The models corresponding this query is 

- AccountRoles (enum class)
- Workshop (annotated class)
- Account (annotated class)  

  

    NamedQuery(name="namedOne", query="from Workshop s inner join Account a where a.account_role = :role"

I have tried this one query which is probably wrong, another one like this

    NamedQuery(name="namedOne", query="from Workshop accounts.account_role = :role"

The field accounts contains 

    @OneToMany(fetch=FetchType.EAGER)
    @JoinTable(name="links_ws2accounts")
    public List<models.ws.Account> accounts = new ArrayList<models.ws.Account>();


Any suggestion is appreciated, if you need a bit more info let me know


HQL query with enums
===

I'm trying to make this query work, in my model Workshop I have a enum type field where it connects to roles. 

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". 

The models corresponding this query is 

- AccountRoles (enum class)
- Workshop (annotated class)
- Account (annotated class)  

  

    NamedQuery(name="namedOne", query="from Workshop s inner join Account a where a.account_role = :role"

I have tried this one query which is probably wrong, another one like this

    NamedQuery(name="namedOne", query="from Workshop accounts.account_role = :role"

The field accounts contains 

    @OneToMany(fetch=FetchType.EAGER)
    @JoinTable(name="links_ws2accounts")
    public List<models.ws.Account> accounts = new ArrayList<models.ws.Account>();


Any suggestion is appreciated, if you need a bit more info let me know

