You can just call your function inside of the HQL. It has been my experience that if hibernate does not recognize something as an object or property of an object in the query, it will leave it as is.
Something like this should work:
Code:
from myobject as analias where
analias.columnA = 1 and analias.columnB IN(select analias2.myproperty from myobject2 where analias2.aproperty = 'a value')
I have not tried to do anything with an array like you are doing, but this may work:
Code:
from myobject as analias where
analias.columnA = 1 and analias.columnB IN(my_function())
Hope that helps.
Paul