title: convert subquery to a join in jpql
body: <p>I have two classes ClassA and ClassB. Many ClassB's can have association with a single ClassA, hence a many-to-one relationship from ClassB to ClassA. Relationship is  like:</p>
  
  <pre><code>ClassA {
      @ManyToOne(optional = false)
      @JoinColumn(name = "ClassB_ID", referencedColumnName = "ID", nullable = false)
      private ClassB classB = new ClassB();
  }
  </code></pre>
  
  <p>I have a query like this: </p>
  
  <pre><code>delete from ClassA as a 
  where a.classB in (select b from ClassB as b where b.attr1=?1 and b.attr2=?2)
  and a.attr3=?3
  </code></pre>
  
  <p>And i converted this query like:</p>
  
  <pre><code>delete from ClassA as a join a.classb as b where b.attr1=?1 and b.attr2=?2
  and a.attr3=?3"
  </code></pre>
  
  <p>When i run this i get below exception :</p>
  
  <blockquote>
  <pre><code>ERROR PARSER    - line 1:28: unexpected token: join
  
  org.springframework.dao.InvalidDataAccessApiUsageException:
  </code></pre>
    
    <p>node to traverse cannot be null!;
    nested exception is
    java.lang.IllegalArgumentException:
    node to traverse cannot be null!</p>
  </blockquote>
  
  <p>Can anybody help ? </p>
  
  <p>Thanks.</p>