From fcdc281219a350517d4a1a2dc06a2a8714276b2b Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Sat, 16 Feb 2019 13:24:34 +0200 Subject: [PATCH] UserInfoTable is now static information class: - Made constructor private - Removed getter in SQLDB --- .../src/main/java/com/djrapitops/plan/db/SQLDB.java | 9 --------- .../djrapitops/plan/db/sql/tables/UserInfoTable.java | 11 ++++------- .../database/databases/sql/operation/SQLOps.java | 3 --- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/Plan/common/src/main/java/com/djrapitops/plan/db/SQLDB.java b/Plan/common/src/main/java/com/djrapitops/plan/db/SQLDB.java index ebd007662..6bbde609c 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/db/SQLDB.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/db/SQLDB.java @@ -28,7 +28,6 @@ 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.sql.tables.UserInfoTable; 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; @@ -71,7 +70,6 @@ public abstract class SQLDB extends AbstractDatabase { protected final Timings timings; protected final ErrorHandler errorHandler; - private final UserInfoTable userInfoTable; private final TPSTable tpsTable; private final SQLFetchOps fetchOps; @@ -98,8 +96,6 @@ public abstract class SQLDB extends AbstractDatabase { tpsTable = new TPSTable(this); - userInfoTable = new UserInfoTable(this); - fetchOps = new SQLFetchOps(this); } @@ -325,11 +321,6 @@ public abstract class SQLDB extends AbstractDatabase { return tpsTable; } - @Deprecated - public UserInfoTable getUserInfoTable() { - return userInfoTable; - } - @Override @Deprecated public FetchOperations fetch() { diff --git a/Plan/common/src/main/java/com/djrapitops/plan/db/sql/tables/UserInfoTable.java b/Plan/common/src/main/java/com/djrapitops/plan/db/sql/tables/UserInfoTable.java index ae1423e10..2b6e7e24d 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/db/sql/tables/UserInfoTable.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/db/sql/tables/UserInfoTable.java @@ -17,16 +17,13 @@ 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.UserInfoOptimizationPatch; import com.djrapitops.plan.db.patches.Version10Patch; import com.djrapitops.plan.db.sql.parsing.CreateTableParser; import com.djrapitops.plan.db.sql.parsing.Sql; /** - * Table that is in charge of storing server specific player data. - *

- * Table Name: plan_user_info + * Table information about 'plan_user_info'. *

* Patches related to this table: * {@link Version10Patch} @@ -34,7 +31,7 @@ import com.djrapitops.plan.db.sql.parsing.Sql; * * @author Rsl1122 */ -public class UserInfoTable extends Table { +public class UserInfoTable { public static final String TABLE_NAME = "plan_user_info"; @@ -53,8 +50,8 @@ public class UserInfoTable extends Table { OP + ") VALUES (?, ?, ?, ?, ?)"; - public UserInfoTable(SQLDB db) { - super(TABLE_NAME, db); + private UserInfoTable() { + /* Static information class */ } public static String createTableSQL(DBType dbType) { diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/database/databases/sql/operation/SQLOps.java b/Plan/common/src/main/java/com/djrapitops/plan/system/database/databases/sql/operation/SQLOps.java index e816e0246..80153ef42 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/database/databases/sql/operation/SQLOps.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/database/databases/sql/operation/SQLOps.java @@ -18,20 +18,17 @@ package com.djrapitops.plan.system.database.databases.sql.operation; import com.djrapitops.plan.db.SQLDB; import com.djrapitops.plan.db.sql.tables.TPSTable; -import com.djrapitops.plan.db.sql.tables.UserInfoTable; @Deprecated public class SQLOps { protected final SQLDB db; - protected final UserInfoTable userInfoTable; protected final TPSTable tpsTable; public SQLOps(SQLDB db) { this.db = db; - userInfoTable = db.getUserInfoTable(); tpsTable = db.getTpsTable(); } }