Fixed sqlite -> sqlite backup

This commit is contained in:
Rsl1122 2018-07-16 19:04:27 +03:00
parent 62221b1582
commit 2c9f89eb50
3 changed files with 33 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import org.apache.commons.dbcp2.BasicDataSource;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Objects;
/**
* @author Rsl1122
@ -73,4 +74,19 @@ public class MySQLDB extends SQLDB {
}
super.close();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
MySQLDB mySQLDB = (MySQLDB) o;
return Objects.equals(dataSource, mySQLDB.dataSource);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), dataSource);
}
}

View File

@ -11,6 +11,7 @@ import org.apache.commons.dbcp2.BasicDataSource;
import java.io.File;
import java.sql.*;
import java.util.Objects;
/**
* @author Rsl1122
@ -136,4 +137,19 @@ public class SQLiteDB extends SQLDB {
}
super.close();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
SQLiteDB sqLiteDB = (SQLiteDB) o;
return Objects.equals(dbName, sqLiteDB.dbName);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), dbName);
}
}

View File

@ -87,7 +87,7 @@ public class BatchOperationTable extends Table {
copyPings(toDB);
}
private void copyPings(BatchOperationTable toDB) {
public void copyPings(BatchOperationTable toDB) {
if (toDB.equals(this)) {
return;
}