How should I refer to inner enums (defined within an entity) from a JPQL query using Hibernate? : <p>I have an entity class as follows:</p>

<pre><code>package stuff;

@Entity
class Thing {

    @Id
    @GeneratedValue 
    private Long id;

    @Basic
    @Enumerated
    private State state;

    public enum State {
        AWESOME,
        LAME
    }
}
</code></pre>

<p>How can I select all Things with state AWESOME using JPQL and Hibernate?</p>

<pre><code>select t from Thing t where t.state=stuff.Thing.State.AWESOME
</code></pre>

<p>...gives the error...</p>

<pre><code>org.hibernate.hql.internal.ast.QuerySyntaxException: Invalid path: 'stuff.Thing.State.AWESOME'
</code></pre>
