title: How to write query(include subquery and exists) using JPA Criteria Builder
body: <p>Struggling to write the following query using JPA.</p>
  
  <p>Oracle Query:</p>
  
  <pre><code>Select * from table1 s
  where exists (Select 1 from table2 p
                INNER JOIN table3 a ON a.table2_id = p.id
                WHERE a.id = s.table3_id
                AND p.name = 'Test');
  </code></pre>
  
  <p>Also, would you like to point any good tutorial to write complex queries in JPA.</p>