Hello, Is there a work around to fix this kind of error I have criteria query like this Criteria criteria = session.createCriteria(blog.class); criteria.add(Restrictions.in("id", id_list)); blogs = criteria.list(); Code (markup): id_list is large list of ids that i want to query in another table. Unfotunately it doesnt work if the value of id_list is more than 2000. I get this error: Prepared or callable statement has more than 2000 parameter markers. Code (markup): Anyone have idea? Please help. THanks
Unfortunately you are stuck at that limit. There are many workarounds you can use including: Creating temp tables (if that's an option), store those ids there and subquery the results that way. Use lists of lists to store a count of <2000 items and query each list on its own then combine the data, sample code here.