NOTE: If you have a question rather than a bug report or feature request,
please post at http://groups.google.com/group/java-generic-dao .
What steps will reproduce the problem?
1. In the case I want do an in query
2. I find a list of elements in some time this list may not contains any element
3. I use the Restrictions.in(property, list)
What is the expected output? What do you see instead?
the expected result may something like this Entity.property in ()
but the result is Entity.property in )
What version of the product are you using? On what operating system?
Version 1.1.3
Please provide any additional information below.
public String toSqlString(Criteria criteria, Criteria.CriteriaQuery criteriaQuery) {
String sql = criteriaQuery.getPropertyName(property, criteria) + " in ( ";
for (Object v : values) {
criteriaQuery.setParam(v);
sql += "?,";
}
return sql.substring(0, sql.length() - 1) + ")";
}
the return statement not consider the case values.length < 1
the easyest way to solve this problem is add a space after the "in ( "
Original issue reported on code.google.com by jackydu1...@gmail.com on 19 Jun 2013 at 6:29
Original issue reported on code.google.com by
jackydu1...@gmail.com
on 19 Jun 2013 at 6:29