title: Does the HQL IN clause only accept a limited number of values (MySQL database)?
body: <p>Here is my <em>simplified</em> database:</p>
  
  <pre><code>user_post
  - id
  - post_id (FK)
  
  post
  - id
  - link_id (FK)
  
  link
  - id
  </code></pre>
  
  <p>I've a list of <code>user_post</code> and I wanna get for each of them the <code>link</code> they are linked to.</p>
  
  <p>Currently, I'm doin it like this:</p>
  
  <pre><code>SELECT userPost.post.link FROM UserPost userPost WHERE userPost IN (:userPosts)
  </code></pre>
  
  <p>Works great, but maybe later, I'll get a huge number of <code>user_post</code>, so there'll be a lot of values within the <code>IN</code> clause (100 &lt; x &lt; 5000+).</p>
  
  <p>Is <code>IN</code> limited? Is there any other way to do it? Before, I was doin it like this:</p>
  
  <pre><code>for (UserPost userPost : user.getUserPosts()) {
      Link link = userPost.getPost().getLink();
      //
  }
  </code></pre>
  
  <p>But the solution above takes really a lot of time to get executed, so I'm lookin for a more optimized one.</p>