P.S.
P.S.

Reputation: 647

"Not in" constraint using JPA criteria

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?

Upvotes: 50

Views: 36562

Answers (1)

jYeory
jYeory

Reputation: 996

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

Upvotes: 98

Related Questions