Changes to WorldTable:

- Removed 'extends Table'
- Made constructor private
- Now only contains static variables and methods
- Removes getter from SQLDB
This commit is contained in:
Rsl1122 2019-01-29 11:13:20 +02:00
parent b5ecc227f1
commit 57827b9154
4 changed files with 4 additions and 32 deletions

View File

@ -78,7 +78,6 @@ public abstract class SQLDB extends AbstractDatabase {
private final GeoInfoTable geoInfoTable;
private final TPSTable tpsTable;
private final SecurityTable securityTable;
private final WorldTable worldTable;
private final WorldTimesTable worldTimesTable;
private final ServerTable serverTable;
private final PingTable pingTable;
@ -121,7 +120,6 @@ public abstract class SQLDB extends AbstractDatabase {
nicknamesTable = new NicknamesTable(this);
sessionsTable = new SessionsTable(this);
killsTable = new KillsTable(this);
worldTable = new WorldTable(this);
worldTimesTable = new WorldTimesTable(this);
pingTable = new PingTable(this);
settingsTable = new SettingsTable(this);
@ -385,11 +383,6 @@ public abstract class SQLDB extends AbstractDatabase {
return securityTable;
}
@Deprecated
public WorldTable getWorldTable() {
return worldTable;
}
@Deprecated
public WorldTimesTable getWorldTimesTable() {
return worldTimesTable;

View File

@ -66,8 +66,6 @@ public class WorldsServerIDPatch extends Patch {
@Override
protected void applyPatch() {
WorldTable worldTable = db.getWorldTable();
List<UUID> serverUUIDs = db.getServerTable().getServerUUIDs();
Map<UUID, Collection<String>> worldsPerServer = new HashMap<>();

View File

@ -17,19 +17,14 @@
package com.djrapitops.plan.db.sql.tables;
import com.djrapitops.plan.db.DBType;
import com.djrapitops.plan.db.SQLDB;
import com.djrapitops.plan.db.patches.Version10Patch;
import com.djrapitops.plan.db.patches.WorldsOptimizationPatch;
import com.djrapitops.plan.db.patches.WorldsServerIDPatch;
import com.djrapitops.plan.db.sql.parsing.CreateTableParser;
import com.djrapitops.plan.db.sql.parsing.Sql;
import java.util.Objects;
/**
* Table class representing database table plan_worlds.
* <p>
* Used for storing id references to world names.
* Table information about 'plan_worlds'.
* <p>
* Patches related to this table:
* {@link Version10Patch}
@ -38,7 +33,7 @@ import java.util.Objects;
*
* @author Rsl1122
*/
public class WorldTable extends Table {
public class WorldTable {
public static final String TABLE_NAME = "plan_worlds";
@ -56,8 +51,8 @@ public class WorldTable extends Table {
" AND (" + TABLE_NAME + "." + SERVER_UUID + "=?)" +
" LIMIT 1)";
public WorldTable(SQLDB db) {
super(TABLE_NAME, db);
private WorldTable() {
/* Static information class */
}
public static String createTableSQL(DBType dbType) {
@ -67,17 +62,5 @@ public class WorldTable extends Table {
.column(SERVER_UUID, Sql.varchar(36)).notNull()
.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof WorldTable)) return false;
return super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
}

View File

@ -32,7 +32,6 @@ public class SQLOps {
protected final GeoInfoTable geoInfoTable;
protected final TPSTable tpsTable;
protected final SecurityTable securityTable;
protected final WorldTable worldTable;
protected final WorldTimesTable worldTimesTable;
protected final ServerTable serverTable;
protected final PingTable pingTable;
@ -49,7 +48,6 @@ public class SQLOps {
geoInfoTable = db.getGeoInfoTable();
tpsTable = db.getTpsTable();
securityTable = db.getSecurityTable();
worldTable = db.getWorldTable();
worldTimesTable = db.getWorldTimesTable();
serverTable = db.getServerTable();
pingTable = db.getPingTable();