title: JPQL single collection element in WHERE
body: <p>I'm creating a small forum. The entities and their relations are like this:</p>
  
  <p>Entity <code>Topic</code> has a <code>OneToMany</code> relation to <code>Post</code>, <code>Post</code> has a <code>ManyToOne</code> relation to <code>User</code></p>
  
  <p>I want to get all topics for one specific user by checking the author of the first post in each topic. Here is my JPQL:</p>
  
  <pre><code>SELECT t FROM Topic t JOIN t.posts p WHERE p.user=:user
  </code></pre>
  
  <p>But this WHERE will check all posts in topic, I only want to check the first post (This user will be considered as the author of the topic). </p>
  
  <p>Thanks</p>