“不在"使用JPA标准的约束 [英] "Not in" constraint using JPA criteria

查看:89
本文介绍了“不在"使用JPA标准的约束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用JPA Criteria编写NOT IN约束. 我已经尝试过这样的事情:

I am trying to write a NOT IN constraint using JPA Criteria. I've tried something like this:

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

尽管我知道它不会起作用.在以上语法中,如何添加将要检查的property1的集合/列表?

though I know it will not work. In the above syntax, how can I add the collection / list against which property1 that will be checked?

推荐答案

builder.not(root.get({field_name}).in(seqs)) seqs是集合.

这篇关于“不在"使用JPA标准的约束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆