mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-09-06 03:38:06 +02:00
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:
parent
b5ecc227f1
commit
57827b9154
@ -78,7 +78,6 @@ public abstract class SQLDB extends AbstractDatabase {
|
|||||||
private final GeoInfoTable geoInfoTable;
|
private final GeoInfoTable geoInfoTable;
|
||||||
private final TPSTable tpsTable;
|
private final TPSTable tpsTable;
|
||||||
private final SecurityTable securityTable;
|
private final SecurityTable securityTable;
|
||||||
private final WorldTable worldTable;
|
|
||||||
private final WorldTimesTable worldTimesTable;
|
private final WorldTimesTable worldTimesTable;
|
||||||
private final ServerTable serverTable;
|
private final ServerTable serverTable;
|
||||||
private final PingTable pingTable;
|
private final PingTable pingTable;
|
||||||
@ -121,7 +120,6 @@ public abstract class SQLDB extends AbstractDatabase {
|
|||||||
nicknamesTable = new NicknamesTable(this);
|
nicknamesTable = new NicknamesTable(this);
|
||||||
sessionsTable = new SessionsTable(this);
|
sessionsTable = new SessionsTable(this);
|
||||||
killsTable = new KillsTable(this);
|
killsTable = new KillsTable(this);
|
||||||
worldTable = new WorldTable(this);
|
|
||||||
worldTimesTable = new WorldTimesTable(this);
|
worldTimesTable = new WorldTimesTable(this);
|
||||||
pingTable = new PingTable(this);
|
pingTable = new PingTable(this);
|
||||||
settingsTable = new SettingsTable(this);
|
settingsTable = new SettingsTable(this);
|
||||||
@ -385,11 +383,6 @@ public abstract class SQLDB extends AbstractDatabase {
|
|||||||
return securityTable;
|
return securityTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public WorldTable getWorldTable() {
|
|
||||||
return worldTable;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public WorldTimesTable getWorldTimesTable() {
|
public WorldTimesTable getWorldTimesTable() {
|
||||||
return worldTimesTable;
|
return worldTimesTable;
|
||||||
|
@ -66,8 +66,6 @@ public class WorldsServerIDPatch extends Patch {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void applyPatch() {
|
protected void applyPatch() {
|
||||||
WorldTable worldTable = db.getWorldTable();
|
|
||||||
|
|
||||||
List<UUID> serverUUIDs = db.getServerTable().getServerUUIDs();
|
List<UUID> serverUUIDs = db.getServerTable().getServerUUIDs();
|
||||||
|
|
||||||
Map<UUID, Collection<String>> worldsPerServer = new HashMap<>();
|
Map<UUID, Collection<String>> worldsPerServer = new HashMap<>();
|
||||||
|
@ -17,19 +17,14 @@
|
|||||||
package com.djrapitops.plan.db.sql.tables;
|
package com.djrapitops.plan.db.sql.tables;
|
||||||
|
|
||||||
import com.djrapitops.plan.db.DBType;
|
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.Version10Patch;
|
||||||
import com.djrapitops.plan.db.patches.WorldsOptimizationPatch;
|
import com.djrapitops.plan.db.patches.WorldsOptimizationPatch;
|
||||||
import com.djrapitops.plan.db.patches.WorldsServerIDPatch;
|
import com.djrapitops.plan.db.patches.WorldsServerIDPatch;
|
||||||
import com.djrapitops.plan.db.sql.parsing.CreateTableParser;
|
import com.djrapitops.plan.db.sql.parsing.CreateTableParser;
|
||||||
import com.djrapitops.plan.db.sql.parsing.Sql;
|
import com.djrapitops.plan.db.sql.parsing.Sql;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Table class representing database table plan_worlds.
|
* Table information about 'plan_worlds'.
|
||||||
* <p>
|
|
||||||
* Used for storing id references to world names.
|
|
||||||
* <p>
|
* <p>
|
||||||
* Patches related to this table:
|
* Patches related to this table:
|
||||||
* {@link Version10Patch}
|
* {@link Version10Patch}
|
||||||
@ -38,7 +33,7 @@ import java.util.Objects;
|
|||||||
*
|
*
|
||||||
* @author Rsl1122
|
* @author Rsl1122
|
||||||
*/
|
*/
|
||||||
public class WorldTable extends Table {
|
public class WorldTable {
|
||||||
|
|
||||||
public static final String TABLE_NAME = "plan_worlds";
|
public static final String TABLE_NAME = "plan_worlds";
|
||||||
|
|
||||||
@ -56,8 +51,8 @@ public class WorldTable extends Table {
|
|||||||
" AND (" + TABLE_NAME + "." + SERVER_UUID + "=?)" +
|
" AND (" + TABLE_NAME + "." + SERVER_UUID + "=?)" +
|
||||||
" LIMIT 1)";
|
" LIMIT 1)";
|
||||||
|
|
||||||
public WorldTable(SQLDB db) {
|
private WorldTable() {
|
||||||
super(TABLE_NAME, db);
|
/* Static information class */
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String createTableSQL(DBType dbType) {
|
public static String createTableSQL(DBType dbType) {
|
||||||
@ -67,17 +62,5 @@ public class WorldTable extends Table {
|
|||||||
.column(SERVER_UUID, Sql.varchar(36)).notNull()
|
.column(SERVER_UUID, Sql.varchar(36)).notNull()
|
||||||
.toString();
|
.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());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,6 @@ public class SQLOps {
|
|||||||
protected final GeoInfoTable geoInfoTable;
|
protected final GeoInfoTable geoInfoTable;
|
||||||
protected final TPSTable tpsTable;
|
protected final TPSTable tpsTable;
|
||||||
protected final SecurityTable securityTable;
|
protected final SecurityTable securityTable;
|
||||||
protected final WorldTable worldTable;
|
|
||||||
protected final WorldTimesTable worldTimesTable;
|
protected final WorldTimesTable worldTimesTable;
|
||||||
protected final ServerTable serverTable;
|
protected final ServerTable serverTable;
|
||||||
protected final PingTable pingTable;
|
protected final PingTable pingTable;
|
||||||
@ -49,7 +48,6 @@ public class SQLOps {
|
|||||||
geoInfoTable = db.getGeoInfoTable();
|
geoInfoTable = db.getGeoInfoTable();
|
||||||
tpsTable = db.getTpsTable();
|
tpsTable = db.getTpsTable();
|
||||||
securityTable = db.getSecurityTable();
|
securityTable = db.getSecurityTable();
|
||||||
worldTable = db.getWorldTable();
|
|
||||||
worldTimesTable = db.getWorldTimesTable();
|
worldTimesTable = db.getWorldTimesTable();
|
||||||
serverTable = db.getServerTable();
|
serverTable = db.getServerTable();
|
||||||
pingTable = db.getPingTable();
|
pingTable = db.getPingTable();
|
||||||
|
Loading…
Reference in New Issue
Block a user