I used Criteria to create query like Criteria crit = session.createCriteria(XXX.class);. I had an in condition like crit.add(Expression.in("XXX", aaaList)); aaaList is a dynamic list and I found it works when aaaList.size > 0. But when aaaList.size = 0 that means I need not query with this condition, it throws Exception:
java.lang.NegativeArraySizeException
at java.lang.StringBuffer.<init>(StringBuffer.java:115)
..................
Do I have any mistake? Need check aaaList.size == 0? by myself before crit.add(Expression.in("XXX", aaaList)); ?
|