Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Outer joined one-to-many question

On Mon, Aug 19, 2013 at 3:41 PM, Andrei Ilitchev <andrei.ilitchev@xxxxxxxxxx> wrote:
Even called "child" it still refers to a collection to be joined, not to a single collection member.

Now I'm even MORE confused!  :-)

The JPA specification says:

For example, the query

SELECT DISTINCT o
FROM Order o JOIN o.lineItems l
WHERE l.product.productType = ‘office_supplies’

can equivalently be expressed as follows, using the IN operator:

SELECT DISTINCT o
FROM Order o, IN(o.lineItems) l
WHERE l.product.productType = ‘office_supplies’

In this example, lineItems is the name of an association field whose value is a collection of instances of the abstract schema type LineItem. The identification variable l designates a member of this collection, a single LineItem abstract schema type instance. In this example, o is an identification variable of the abstract schema type Order.

Note the second-to-last sentence which says that l (lowercase L) identifies a "single LineItem abstract schema type instance".  Isn't that what my "child" is?

Best,

Back to the top