Removed Table#removeAllData

This commit is contained in:
Rsl1122 2019-01-24 15:37:33 +02:00
parent bdcba82735
commit 5e8cbf1a88
3 changed files with 1 additions and 14 deletions

View File

@ -101,13 +101,6 @@ public abstract class Table {
return tableName;
}
/**
* Removes all data from the table.
*/
public void removeAllData() {
db.execute("DELETE FROM " + tableName);
}
@Override
public String toString() {
return tableName;

View File

@ -55,16 +55,11 @@ public class BatchOperationTable extends Table {
}
}
@Override
public void removeAllData() {
db.executeTransaction(new RemoveEverythingTransaction());
}
public void copyEverything(BatchOperationTable toDB) {
if (toDB.equals(this)) {
return;
}
toDB.removeAllData();
toDB.db.executeTransaction(new RemoveEverythingTransaction());
copyServers(toDB);
copyUsers(toDB);

View File

@ -33,7 +33,6 @@ public class SQLBackupOps extends SQLOps implements BackupOperations {
BatchOperationTable toDB = new BatchOperationTable((SQLDB) toDatabase);
BatchOperationTable fromDB = new BatchOperationTable(db);
toDB.removeAllData();
fromDB.copyEverything(toDB);
} else {
throw new IllegalArgumentException("Database was not a SQL database - backup not implemented.");