EJB‎ > ‎

JPA QL

Select Statement

SELECT c FROM Customer c

IN Operator

SELECT p.number FROM Customer c, IN( c.phones ) p

Inner Join

SELECT p.number FROM Customer c INNER JOIN c.phones p

Left Join (will improve performance if you have lazy fetch type)

SELECT c FROM Customer c LEFT JOIN FETCH c.phones

Bulk Update

UPDATE Employee e SET e.salary = (e.salary + 1000)
WHERE EXISTS (
    SELECT m FROM e.manager m
    WHERE m.name = 'John Doe'
)



Comments