jsr338-experts@jpa-spec.java.net

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

From: Linda DeMichiel <linda.demichiel_at_oracle.com>
Date: Tue, 15 Mar 2011 10:57:14 -0700

I still don't see why a separate keyword is needed for this.

On 3/15/2011 10:55 AM, Emmanuel Bernard wrote:
> On 15 mars 2011, at 17:51, Linda DeMichiel wrote:
>
>> On 3/15/2011 3:31 AM, Emmanuel Bernard wrote:
>>> The doc is minimal, I'm pasting it for info
>>> You may supply extra join conditions using the HQL with keyword.
>>> from Cat as cat
>>> left join cat.kittens as kitten
>>> with kitten.bodyWeight > 10.0
>>> <<<
>>> http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/queryhql.html#queryhql-joins
>>> this essentially concatenate an SQL version of kitten.bodyWeight > 10.0 to the rest of the SQL ON clause used to auto join the Cat table.
>>> My email was really a question, I wanted to confirm that what you were proposing was essentially the same concept.
>> Thanks -- yes.
>>
>>> As for a full ON clause replacement, a few users and customers have requested it over the years. But we have not implemented such a feature yet. I suspect people are willing to do adhoc joins even across non mapped associations. I see it as much less useful than the proposed feature.
>> Same here. We could add it later if requested.
>
> OK nice. So the reason for proposing a different keyword than ON for the "add-on" ON clause was to leave the door open for the full fledge ON replacement. In Hibernate we use WITH.
>
> Emmanuel