假设我们有一个Person
类,其中包含Set<Book> books
。
要查找所有拥有“ Emfective Java”书的人,您可以编写:
select p from Person p left outer join fetch p.books as b where b.name='Effective Java'
现在,我该如何在头上打开此查询,并找到所有Person
没有这本书的书?
select p from Person p "where p.books does not contain book b where b.name='Effective Java'"
答案 0 :(得分:1)
您可以利用 DECLARE @flt FLOAT;
SET @flt = 100 / 3
SELECT @flt + @flt + @flt
关键字:
NOT EXISTS
答案 1 :(得分:0)
或者
select p from Person p join p.books b where b.name <> 'Effective Java'