【发布时间】:2010-11-15 03:50:27
【问题描述】:
如果是这样,语法是什么?
假设我希望 Foo 的一个实例与 Bar 的所有实例不关联: 在 SQL 中,它只是:
delete from FOO_BAR_MAPPING
where FOO_ID = ?
在 HQL 中,我假设它是这样的:
delete from Bar.foos foos
where foos.id = :id
(其中 foos 是 Foo 的映射集合)
但是好像错了,给:
org.hibernate.hql.ast.QuerySyntaxException: Bar.foos is not mapped
HQL 甚至可以做到这一点吗?
【问题讨论】: