In Oracle there is the operator (+)
, to make an outer join, in a where construct e.g. SELECT * FROM table t, other_table ot WHERE t.id = ot.tale_id(+)
, is there a similar comfortable way, to do that in a HQL?
SUPPLEMENT: Or is there any other way to make the where condition an outer join?
Is there any way to specify a left outer join
in HQL?
Yes, HQL does support left outer joins via explicit join syntax, and the syntax is identical to SQL's (with the implied navigation property as the join key):
from Cat as cat
left join cat.kittens as kitten
outer
is optional, viz left [outer] join
Is there a shorthand abbreviation for left outer join
, like Oracle's (+)
No, AFAIK the HQL documentation makes no reference to a shorthand left outer join
notation, and if HQL adheres to the trend in RDBMS to remove proprietary join syntax, as per @a_horse_with_no_name's comment, Oracle recommends against using the proprietary (+) syntax, and similarly *= in MSSql Server has been deprecated.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments