Hello all! I've been playing with the latest EJB3 stuff and I really like it. It's much better than the EJB2 way of doing things.
I'm pretty new to writing EJB queries, and I'm having trouble finding an example of what I need to do. I hope someone can point me in the right direction.
Basically I have a Person entity with a collection of Persons as an attribute called children. Something like this:
public class Person{ private String firstName; private Collection<Person> children; }
What you are looking for is IN keyword.
SELECT p FROM Person p, IN(p.children) c WHERE ...
Simpler than JOIN method.