Fix parameter index in getCount function.

This commit is contained in:
Hugo Trippaers 2014-02-20 14:04:51 +01:00
parent fe83a85436
commit 19b15a1bdc

View File

@ -1878,10 +1878,10 @@ public abstract class GenericDaoBase<T, ID extends Serializable> extends Compone
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
try { try {
pstmt = txn.prepareAutoCloseStatement(sql); pstmt = txn.prepareAutoCloseStatement(sql);
int i = 0; int i = 1;
if (clause != null) { if (clause != null) {
for (final Pair<Attribute, Object> value : sc.getValues()) { for (final Pair<Attribute, Object> value : sc.getValues()) {
prepareAttribute(++i, pstmt, value.first(), value.second()); prepareAttribute(i++, pstmt, value.first(), value.second());
} }
} }