I have 2 entities: EntityA and EntityB.
They are unrelated, and I cannot put them in a Inheritance tree for some restrictions out of the scope of this question.
Well, I finally figured it out.
It is enought to make the entities implement a common interface (it is not even needed to declare this interface on Hibernate).
Then, a query like this can be done:
FROM my.package.CommonInterface obj
WHERE obj IN (FROM EntityA WHERE fieldA=1) OR
obj IN (FROM EntityB WHERE fieldB='a')
This way, you retrieve a List.
Problem solved.