I believe you’ve misunderstood the purpose of the HQL any() function. It’s not the same as the any quantifier. The argument of the any() aggregate function is supposed to be a boolean value.