small questions about Restrictions.
i have query like this :
Where A in(1,6) and (B not like 'Value%' or B not like 'ValueII%')
the problem is the field B not contains a fixed value, can be one or more.
Please, (N)Hibernate experts – help me with this, I cant find a working solution. Any help is greatly appreciated!
You can use disjunctions to handle the OR cases, as such:
If you need to handle the disjunction conditions in a for loop (per your follow-up), you can use code like this:
That being said, I think there may be a flaw in your logic. If you are testing these values to “not match one pattern OR not match another pattern”, then the condition will always evaluate to true (unless the patterns are the same). Are you sure you want to be using ORs here?