jsr338-experts@jpa-spec.java.net

[jsr338-experts] Re: outer joins with ON conditions

From: Linda DeMichiel <linda.demichiel_at_oracle.com>
Date: Wed, 16 Mar 2011 12:15:26 -0700

On 3/16/2011 3:46 AM, Emmanuel Bernard wrote:
> On 15 mars 2011, at 19:16, Linda DeMichiel wrote:
>
>> JPQL would be:
>>
>> FROM Cat as cat LEFT JOIN Kittens k ON k.bodyWeight > 10.0 AND k.parentName = cat.Name
>
> But in this case, the SQL would be
>
> from Cat c OUTER JOIN Kitten k ON c.id = k.parent AND c.name = k.parentName AND k.bodyWeight > 10.0
>
> which is one to many clause for what the user wants to do.

No, the above would not add c.id = k.parent to the SQL ON clause.

Since we only defined JOIN that involves relationship navigation, we
can make this distinction.