Struggling to write the following query using JPA.
Oracle Query:
Select * from table1 s where exists (Select 1 from table2 p INNER JOIN tab
You can do it much simpler using JPA Queries or HQL instead of Criteria builders:
SELECT e1 from Entity1 as e1 where exists (select e2 from Entity2 as e2 join e2.e3 as ent3 where ent3.id=e1.id and e2.name='Test')