no one willing to help?
first of all figure out what query are you trying to generate in the DB...
then.. translate it to HQL.. so the question is... can you do it in one query in your DB?
If you use in ( :actorIds ) why you don't use in ( :processInstances )??