this.validateTypes();
final WithArgs withArgs = this.getWithArgs();
final Set<ColumnAttrib> allWhereAttribs = withArgs.getColumnsUsedInAllWhereExprs();
HTableWrapper tableWrapper = null;
try {
tableWrapper = conn.newHTableWrapper(withArgs, this.getMappingContext().getMapping().getTableName());
final List<RowRequest> rowRequests = withArgs.getRowRequestList(conn,
this.getMappingContext().getMapping(),
allWhereAttribs);
int cnt = 0;
for (final RowRequest rowRequest : rowRequests)
cnt += this.delete(tableWrapper, withArgs, rowRequest);
try {
tableWrapper.getHTable().flushCommits();
tableWrapper.getHTable().close();
}
catch (IOException e) {
throw new HBqlException(e);
}
final ExecutionResults results = new ExecutionResults("Delete count: " + cnt);
results.setCount(cnt);
return results;
}
finally {
// release to table pool
if (tableWrapper != null)
tableWrapper.releaseHTable();
}
}