“Not in” constraint using JPA criteria

﹥>﹥吖頭↗ 提交于 2019-12-20 09:26:59

问题


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)));

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?


回答1:


builder.not(root.get({field_name}).in(seqs)) seqs is collection.



来源:https://stackoverflow.com/questions/5115422/not-in-constraint-using-jpa-criteria

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!