DetachedCriteria criteria = DetachedCriteria.forClass(Client.class);
criteria.add(Restrictions.in("clientId",getClientIds()) );
I created a seperate method getClientIds which gives back a list of clientIds. The problem occured when the number of clientIds returned by getClientIds method is more than 1000. IN operator against oracle fails with an exception if the number of items in the IN operator is > 1000. I got over this problem by replacing the clientId IN (id1, id2, id3,...id1000) kind of clause by clientId IN (innerQuery).
No comments:
Post a Comment