Skip to content
Advertisement

HQL query checking each item of list against multiple requirements

I want to filter a query based on the contents of a list on the entity. I do not simply want to check if something is in this list, I want to have a ‘predicate’ as in functional programming, It’s been challenging to research since ‘predicate’ is something else in hql.

so basically

JavaScript

Is what I want in my hql.

JavaScript

I’ve looked at using expression operator ANY (subquery) but I don’t see how it gets all the way there. I need to have my entire expression as a check against each item in the list.

Does HQL have something for this, what is it called?

Advertisement

Answer

Try to use the following query:

JavaScript

See also this section of the hibernate documentation.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement