}
whereSQL.append(column);
whereSQL.append(" = ?");
keyCount++;
keyBindVariables.add( new BoundVariable( keyCount, column, pd.getPropertyType(), value ) );
}
else
{
Class type = pd.getPropertyType();
StringBuffer col = new StringBuffer();
if (value == null ||
(type == Integer.class || "int".equals(type.getName())) && ((Integer) value < 0) ||
( type == Double.class || "double".equals( type.getName() ) ) && ((Double) value < 0.0d))
{
continue;
}
if (columnCount > 0)
{
col.append(", ");
}
col.append(column);
col.append(" = ");
col.append("?");
columnCount++;
bindVariables.add(new BoundVariable(columnCount, column, type, value));
sql.append(col);
}
}
// add the keys to the bind variable list
for ( BoundVariable bv : keyBindVariables)
{
bindVariables.add( new BoundVariable(columnCount + bv.getPosition(), bv.getName(), bv.getType(), bv.getValue() ) );
}
sql.append( whereSQL );
return sql.toString();
}