Friday, December 5, 2008

JPA One to Many query

Assume there is a parent entity and has one to many relationship with a child entity. We want to write a query where in a record of parent entity is comapred against each row of its children, we can IN operator.For example 

SELECT e.name, d.name from Department d, IN(d.employees) e where e.salary > 100000

No comments: