public void executeOnTables(ITableFilterSimple aTables,
final TableSetOperation aOperation) throws Exception {
- final String[] tables = getTableNames(aTables);
+ final String[] tableNames = getTableNames(aTables);
executeInTransaction(new JdbcUnitOfWork<Void>() {
public Void execute(Connection aConnection) throws Exception {
- for (int i = tables.length - 1; i >= 0; i--) {
- aOperation.execute(tables[i]);
+ for (int i = tableNames.length - 1; i >= 0; i--) {
+ aOperation.execute(tableNames[i]);
}
return null;
}
public void cleanDatabase(ITableFilterSimple aSelection) throws Exception {
- final String[] tables = getTableNames(aSelection);
+ final String[] tableNames = getTableNames(aSelection);
executeInTransaction(new JdbcUnitOfWork<Void>() {
public Void execute(Connection aConnection) throws Exception {
IDatabaseConnection connection = new DatabaseConnection(
aConnection);
ITableFilter filter = new DatabaseSequenceFilter(connection,
- tables);
+ tableNames);
IDataSet dataset = new FilteredDataSet(filter, connection
- .createDataSet(tables));
+ .createDataSet(tableNames));
DatabaseOperation.DELETE_ALL.execute(connection, dataset);
return null;
}
Connection connection = dataSource.getConnection();
try {
- ResultSet tables = connection.getMetaData().getTables(null,
+ ResultSet tableNames = connection.getMetaData().getTables(null,
SCHEMA_PATTERN, "%", new String[] { "TABLE" });
- while (tables.next()) {
- String table = tables.getString("TABLE_NAME");
+ while (tableNames.next()) {
+ String table = tableNames.getString("TABLE_NAME");
if (aSelection.accept(table)) {
result.add(table);
}
}
public void dropTables(ITableFilterSimple aTables) throws Exception {
- final String[] tables = getTableNames(aTables);
+ final String[] tableNames = getTableNames(aTables);
String[] sortedTables = executeInTransaction(new JdbcUnitOfWork<String[]>() {
public String[] execute(Connection aConnection) throws Exception {
IDatabaseConnection connection = new DatabaseConnection(
aConnection);
ITableFilter filter = new DatabaseSequenceFilter(connection,
- tables);
+ tableNames);
IDataSet dataset = new FilteredDataSet(filter, connection
- .createDataSet(tables));
+ .createDataSet(tableNames));
return dataset.getTableNames();
}
});