For HQL query I implemented a solution for creating a helper class for parsing and split the IN expressions, and I call it in AbstractQueryImpl.expandParameterList if the collection is more than 1000 items.