"Not in" constraint using JPA criteria(使用JPA标准的“不在”约束条件)

20 浏览
0 Comments

"Not in" constraint using JPA criteria(使用JPA标准的“不在”约束条件)

我正在尝试使用JPA Criteria编写一个"NOT IN"约束。

我已经尝试了类似这样的代码:

builder.not(builder.in(root.get(property1)));

尽管我知道这样不会起作用。在上述语法中,我应该如何添加集合/列表来检查property1?

0