title: jpql (NamedQuery) subquery not working with parameter
body: <p>I'm using JPQL and a NamedQuery to query the database in a combined question.</p>
  
  <pre><code>@NamedQuery(name = "Entry.findAllForName", query = "Select p From Entry p Where p.entryId In(Select dp.entry From EntryPart dp Where dp.part IN(Select d From Part d Where d.senderId = :name))"),
  </code></pre>
  
  <p>When I run this query, using:</p>
  
  <pre><code>Query query = em.createNamedQuery("Entry.findAllForName").setParameter("name", name);
  List&lt;Entry&gt; list = query.getResultList();
  logger.info("Complete query size: {}", list.size());
  </code></pre>
  
  <p>This does return a result set, but it is 0.</p>
  
  <p>When I change the Named Query to:</p>
  
  <pre><code>@NamedQuery(name = "Entry.findAllForName", query = "Select p From Entry p Where p.entryId In(Select dp.entry From EntryPart dp Where dp.part IN(Select d From Part d Where d.senderId = 'SenderName'))"),
  </code></pre>
  
  <p>It works and I get the expected database result.</p>
  
  <p>I'm not that familiar with JPQL and @NamedQueries, but I can't see the difference between having the String vaule and the parameter value, since when I do a diff, they are the same.</p>
  
  <pre><code>logger.info("SenderName == {} ? {}", name, name.equals("SenderName"));
  </code></pre>
  
  <p>This returns "SenderName == SenderName ? true"...</p>
  
  <p>Best,
  Henrik</p>