boolean setAttrs, boolean batch)
throws NdbApiException {
beginTransaction();
for (int i = from; i <= to; i++) {
// get an insert operation for the table
final NdbOperation op = tx.getInsertOperation(table);
assert op != null;
// set key attribute
op.equalInt(model.name_id, i);
// set other attributes
if (setAttrs) {
op.setInt(model.name_cint, -i);
op.setLong(model.name_clong, -i);
op.setFloat(model.name_cfloat, -i);
op.setDouble(model.name_cdouble, -i);
}
// execute the operation now if in non-batching mode
if (!batch)
executeOperations();