As well known we can't use starts with / connect by in HQL. However I have to use HQL and not native therefore I came with a solution of : 1. fetching my hierarchy data into an id list. 2. Concatenating the id list into "IN" clause in my HQL query.
It work fine obviously, until my id list became larger then 2,000 id's. (oracle parameter count limitation) The hierarchy fetch is an organization query in a large organization.
The only solution I could think of is to divide my id list to sub queries of lets say 1,000 id's and then unifying my results.
Has anyone encountered with a similar problem ?
thanks, Ariel.
|