mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-24 18:17:53 +01:00
TPSTable now static information class:
- Made constructor private - Removed getter in SQLDB
This commit is contained in:
parent
ba41952bee
commit
463f56f340
@ -27,7 +27,6 @@ import com.djrapitops.plan.db.access.transactions.init.CleanTransaction;
|
||||
import com.djrapitops.plan.db.access.transactions.init.CreateIndexTransaction;
|
||||
import com.djrapitops.plan.db.access.transactions.init.CreateTablesTransaction;
|
||||
import com.djrapitops.plan.db.patches.*;
|
||||
import com.djrapitops.plan.db.sql.tables.TPSTable;
|
||||
import com.djrapitops.plan.db.tasks.PatchTask;
|
||||
import com.djrapitops.plan.system.database.databases.operation.FetchOperations;
|
||||
import com.djrapitops.plan.system.database.databases.sql.operation.SQLFetchOps;
|
||||
@ -70,8 +69,6 @@ public abstract class SQLDB extends AbstractDatabase {
|
||||
protected final Timings timings;
|
||||
protected final ErrorHandler errorHandler;
|
||||
|
||||
private final TPSTable tpsTable;
|
||||
|
||||
private final SQLFetchOps fetchOps;
|
||||
|
||||
private PluginTask dbCleanTask;
|
||||
@ -94,8 +91,6 @@ public abstract class SQLDB extends AbstractDatabase {
|
||||
this.timings = timings;
|
||||
this.errorHandler = errorHandler;
|
||||
|
||||
tpsTable = new TPSTable(this);
|
||||
|
||||
fetchOps = new SQLFetchOps(this);
|
||||
}
|
||||
|
||||
@ -316,11 +311,6 @@ public abstract class SQLDB extends AbstractDatabase {
|
||||
transaction.executeTransaction(this);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public TPSTable getTpsTable() {
|
||||
return tpsTable;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public FetchOperations fetch() {
|
||||
|
@ -126,9 +126,8 @@ public class Version10Patch extends Patch {
|
||||
|
||||
private void copyTPS() {
|
||||
String tempTableName = "temp_tps";
|
||||
TPSTable tpsTable = db.getTpsTable();
|
||||
|
||||
renameTable(tpsTable.toString(), tempTableName);
|
||||
renameTable(TPSTable.TABLE_NAME, tempTableName);
|
||||
|
||||
execute(TPSTable.createTableSQL(dbType));
|
||||
|
||||
|
@ -17,18 +17,15 @@
|
||||
package com.djrapitops.plan.db.sql.tables;
|
||||
|
||||
import com.djrapitops.plan.db.DBType;
|
||||
import com.djrapitops.plan.db.SQLDB;
|
||||
import com.djrapitops.plan.db.sql.parsing.CreateTableParser;
|
||||
import com.djrapitops.plan.db.sql.parsing.Sql;
|
||||
|
||||
/**
|
||||
* Table that is in charge of storing TPS, Players Online and Performance data.
|
||||
* <p>
|
||||
* Table Name: plan_tps
|
||||
* Table information about 'plan_tps'.
|
||||
*
|
||||
* @author Rsl1122
|
||||
*/
|
||||
public class TPSTable extends Table {
|
||||
public class TPSTable {
|
||||
|
||||
public static final String TABLE_NAME = "plan_tps";
|
||||
|
||||
@ -56,8 +53,8 @@ public class TPSTable extends Table {
|
||||
+ ServerTable.STATEMENT_SELECT_SERVER_ID + ", "
|
||||
+ "?, ?, ?, ?, ?, ?, ?, ?)";
|
||||
|
||||
public TPSTable(SQLDB db) {
|
||||
super(TABLE_NAME, db);
|
||||
private TPSTable() {
|
||||
/* Static information class */
|
||||
}
|
||||
|
||||
public static String createTableSQL(DBType dbType) {
|
||||
|
@ -17,18 +17,13 @@
|
||||
package com.djrapitops.plan.system.database.databases.sql.operation;
|
||||
|
||||
import com.djrapitops.plan.db.SQLDB;
|
||||
import com.djrapitops.plan.db.sql.tables.TPSTable;
|
||||
|
||||
@Deprecated
|
||||
public class SQLOps {
|
||||
|
||||
protected final SQLDB db;
|
||||
|
||||
protected final TPSTable tpsTable;
|
||||
|
||||
public SQLOps(SQLDB db) {
|
||||
this.db = db;
|
||||
|
||||
tpsTable = db.getTpsTable();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user