Revisit HHH Hibernate does not have any explicit handling for excessive expressions in an in - 1123 list expression in context HQL. There are many reported issues that come out of AST-based query processing this (see linked issues, and their linked issues). In my opinion, the vast majority of these come from (imo) invalid queries.
However, there is one use case where this complaint comes up that is valid imo; specifically the case of wanting to load multiple entities by id at one shot. We should develop an API for allowing this. Something along the lines of:
{code:title=IdentifierLoadAccess.java} public interface IdentifierLoadAccess<T> { ... public <K extends Serializable> List<T> multiLoad(K... ids); public <K extends Serializable> List<T> multiLoad(List<K> ids); } {code}
|