title: Criteria API with isMember() gives unexpected end of subtree for elementCollection
body: <p>I'm trying to get the following HQL to work with the criteria API:</p>
  
  <pre><code>SELECT f FROM PotentialDonorFile f WHERE :causeParam MEMBER OF f.causesOfDeath
  </code></pre>
  
  <p>But when I do that I'm always getting the following exception: </p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected end of subtree [select generatedAlias0 from be.fgov.health.gift.action.domain.potentialdonorfile.PotentialDonorFile as generatedAlias0 where ( 1=1 ) and ( :param0 member of generatedAlias0.causesOfDeath ) order by generatedAlias0.modificationDate asc]
  </code></pre>
  
  <p>My case:</p>
  
  <pre><code>@Entity
  @Table(name = "POTENTIAL_DONOR_FILE")
  @SequenceGenerator(name = Domain.SEQUENCE_GENERATOR_NAME, sequenceName = "PDF_SEQUENCE")
  //Domain contains the Id
  public class PotentialDonorFile extends Domain {
  
     @ElementCollection(fetch = FetchType.EAGER)
     @CollectionTable(name = "CAUSES_OF_DEATH",
      joinColumns = @JoinColumn(name = PDF_ID_JOIN_COLUMN_NAME))
     @Column(name = "CAUSE_OF_DEATH")
     @Enumerated(EnumType.STRING)
     @Fetch(FetchMode.SELECT)
     private List&lt;CauseOfDeath&gt; causesOfDeath;
  
  }
  </code></pre>
  
  <p>code:</p>
  
  <pre><code> Predicate filterCondition = cb.conjunction();
  
   Expression&lt;List&lt;CauseOfDeath&gt;&gt; listExpression = potentialDonorFileRoot.get(PotentialDonorFile_.causesOfDeath);
   filterCondition = cb.and(filterCondition, cb.isMember(CauseOfDeath.AUTHANASIA_CASE, listExpression));
  
   cq.where(filterCondition);
  </code></pre>
  
  <p>using jBoss 7.1.1</p>
  
  <p>even the HQL query itself seems to be throwing the same exception.. Just found <a href="https://hibernate.atlassian.net/browse/HHH-5209" rel="nofollow">https://hibernate.atlassian.net/browse/HHH-5209</a> and can't update my hibernate version.. Any ideas?</p>
  
  <p>EDIT:
  I've changed to code to use native SQL. Ofcourse this isn't a perfect solution. If anyone knows a workaround, please answer..</p>