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