O'Reilly logo

Sams Teach Yourself EJB in 21 Days by Krishna Kothapalli, Ragae Ghaly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Declaring the Deployment Descriptors

EJB QL enables you to traverse entity bean relationships. In this section, we discuss how to declare collection members in EJB QL and then present the full listing of the deployment descriptors.

Collection Member Declarations

In a one-to-many or a many-to-many relationship, the many side of the relationship consists of a collection of entity beans. You can declare a collection of values, in the FROM clause, using a collection member declaration. An identification variable of a collection member declaration is declared using the IN operator. For example, a finder method query to find all orders with pending line items can be written as follows:

 SELECT DISTINCT OBJECT(o) FROM Order AS o, IN(o.lineItems) as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required