Hello,
How can I define a QL for getting Entity from Collections?
class User {
List addresses;
}
class Address {
protected String state;
}
how can I retrieve all the User if the user's state is 'MA' or 'NY'?
how can I define the NamedQuery for that?
Best regards,
Eric
Hi Eric,
I think it should be this:
@NamedQuery (name="findUsersByState", query="select o from User o where o.adresses.state in ('MA', 'NY')") @Entity() public class User implements Serializable { ...