title: HQL unexpected AST node: {vector}
body: <p>I'm trying to write an HQL query to grab a list of users that belong to a particular organisation, or any franchisee from a list of franchisees, however hibernate isn't able to parse it. I can't figure out why. Here is the HQL:</p>
  
  <pre><code>from User u where 
  (u.parentOrganisation = :topLevelOrganisation or u.parentOrganisation in :franchisees) 
  and u.parentOrganisation.deleted = false 
  and u.active = true
  </code></pre>
  
  <p>This is the error that hibernate spits out:</p>
  
  <pre><code>unexpected AST node: {vector} [from com.myapp.User u where (u.parentOrganisation = :topLevelOrganisation or u.parentOrganisation in :franchisees0_, :franchisees
  1_, :franchisees2_) and u.parentOrganisation.deleted = false and u.active = true]. Stacktrace follows:
  Message: unexpected AST node: {vector} [from com.myapp.User u where (u.parentOrganisation = :topLevelOrganisation or u.parentOrganisation in :franchisees0_, :fr
  anchisees1_, :franchisees2_) and u.parentOrganisation.deleted = false and u.active = true]
  </code></pre>
  
  <p>If I take out the <code>or u.parentOrganisation in :franchisees</code> bit, so my query looks like this:</p>
  
  <pre><code>from User u where 
  (u.parentOrganisation = :topLevelOrganisation) 
  and u.parentOrganisation.deleted = false 
  and u.active = true
  </code></pre>
  
  <p>Then it works fine. What's wrong with my syntax? Why is hibernate complaining about that extra clause?</p>