select c
from Customer c
join c.orders o
join o.lineItems l
join l.product p
where o.status = 'pending'
and p.status = 'backorder'
// alternate syntax
select c
from Customer c,
in(c.orders) o,
in(o.lineItems) l
join l.product p
where o.status = 'pending'
and p.status = 'backorder'
select c
from Customer c
join c.orders o
join o.lineItems l
join l.product p
where o.status = 'pending'
and p.status = 'backorder'
// alternate syntax
select c
from Customer c,
in(c.orders) o,
in(o.lineItems) l
join l.product p
where o.status = 'pending'
and p.status = 'backorder'
Copy to ClipboardCopied!Toggle word wrapToggle overflow
在这个示例中,标识变量 o 实际指的是对象模型类型顺序,这是客户#顺序关联元素的类型。
示例还显示了使用 IN 语法指定集合关联接合的替代语法。两种形式都是等同的。哪种应用程序选择使用就只是一个体验问题。