1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 14:05:25 +01:00

Lets keep backwards compatability for time being

This commit is contained in:
Zrips 2019-10-31 10:32:08 +02:00
parent 633ad3dcc3
commit 965b74b45a

View File

@ -970,13 +970,10 @@ public abstract class JobsDAO {
return; return;
PreparedStatement exploreStatement = null; PreparedStatement exploreStatement = null;
try { try {
exploreStatement = conn.prepareStatement("UPDATE `" + DBTables.ExploreDataTable.getTableName() + "` SET `" + ExploreDataTableFields.worldid.getCollumn() + "` = ?, `" exploreStatement = conn.prepareStatement("UPDATE `" + DBTables.ExploreDataTable.getTableName() + "` SET `" + ExploreDataTableFields.worldid.getCollumn() + "` = ? WHERE `" + ExploreDataTableFields.worldname.getCollumn() + "` = ?;");
+ ExploreDataTableFields.worldname
.getCollumn() + "` = ? WHERE `" + ExploreDataTableFields.worldname.getCollumn() + "` = ?;");
for (Entry<String, JobsWorld> jobsWorld : Util.getJobsWorlds().entrySet()) { for (Entry<String, JobsWorld> jobsWorld : Util.getJobsWorlds().entrySet()) {
exploreStatement.setInt(1, jobsWorld.getValue().getId()); exploreStatement.setInt(1, jobsWorld.getValue().getId());
exploreStatement.setString(2, null); exploreStatement.setString(2, jobsWorld.getKey());
exploreStatement.setString(3, jobsWorld.getKey());
exploreStatement.execute(); exploreStatement.execute();
} }
} catch (SQLException e) { } catch (SQLException e) {
@ -987,12 +984,10 @@ public abstract class JobsDAO {
PreparedStatement bpStatement = null; PreparedStatement bpStatement = null;
try { try {
bpStatement = conn.prepareStatement("UPDATE `" + DBTables.BlocksTable.getTableName() + "` SET `" + BlockTableFields.worldid.getCollumn() + "` = ?, `" + BlockTableFields.world bpStatement = conn.prepareStatement("UPDATE `" + DBTables.BlocksTable.getTableName() + "` SET `" + BlockTableFields.worldid.getCollumn() + "` = ?, WHERE `" + BlockTableFields.world.getCollumn() + "` = ?;");
.getCollumn() + "` = ? WHERE `" + BlockTableFields.world.getCollumn() + "` = ?;");
for (Entry<String, JobsWorld> jobsWorld : Util.getJobsWorlds().entrySet()) { for (Entry<String, JobsWorld> jobsWorld : Util.getJobsWorlds().entrySet()) {
bpStatement.setInt(1, jobsWorld.getValue().getId()); bpStatement.setInt(1, jobsWorld.getValue().getId());
bpStatement.setString(2, null); bpStatement.setString(2, jobsWorld.getKey());
bpStatement.setString(3, jobsWorld.getKey());
bpStatement.execute(); bpStatement.execute();
} }
} catch (SQLException e) { } catch (SQLException e) {
@ -1003,12 +998,10 @@ public abstract class JobsDAO {
PreparedStatement archiveStatement = null; PreparedStatement archiveStatement = null;
try { try {
archiveStatement = conn.prepareStatement("UPDATE `" + DBTables.ArchiveTable.getTableName() + "` SET `" + ArchiveTableFields.jobid.getCollumn() + "` = ?, `" + ArchiveTableFields.job archiveStatement = conn.prepareStatement("UPDATE `" + DBTables.ArchiveTable.getTableName() + "` SET `" + ArchiveTableFields.jobid.getCollumn() + "` = ?, WHERE `" + ArchiveTableFields.job.getCollumn() + "` = ?;");
.getCollumn() + "` = ? WHERE `" + ArchiveTableFields.job.getCollumn() + "` = ?;");
for (Job job : Jobs.getJobs()) { for (Job job : Jobs.getJobs()) {
archiveStatement.setInt(1, job.getId()); archiveStatement.setInt(1, job.getId());
archiveStatement.setString(2, null); archiveStatement.setString(2, job.getName());
archiveStatement.setString(3, job.getName());
archiveStatement.execute(); archiveStatement.execute();
} }
} catch (SQLException e) { } catch (SQLException e) {
@ -1019,12 +1012,10 @@ public abstract class JobsDAO {
PreparedStatement usersStatement = null; PreparedStatement usersStatement = null;
try { try {
usersStatement = conn.prepareStatement("UPDATE `" + getJobsTableName() + "` SET `" + JobsTableFields.jobid.getCollumn() + "` = ?, `" + JobsTableFields.job usersStatement = conn.prepareStatement("UPDATE `" + getJobsTableName() + "` SET `" + JobsTableFields.jobid.getCollumn() + "` = ? WHERE `" + JobsTableFields.job.getCollumn() + "` = ?;");
.getCollumn() + "` = ? WHERE `" + JobsTableFields.job.getCollumn() + "` = ?;");
for (Job job : Jobs.getJobs()) { for (Job job : Jobs.getJobs()) {
usersStatement.setInt(1, job.getId()); usersStatement.setInt(1, job.getId());
usersStatement.setString(2, ""); usersStatement.setString(2, job.getName());
usersStatement.setString(3, job.getName());
usersStatement.execute(); usersStatement.execute();
} }
} catch (SQLException e) { } catch (SQLException e) {
@ -1035,12 +1026,10 @@ public abstract class JobsDAO {
PreparedStatement limitsStatement = null; PreparedStatement limitsStatement = null;
try { try {
limitsStatement = conn.prepareStatement("UPDATE `" + DBTables.LimitsTable.getTableName() + "` SET `" + LimitTableFields.typeid.getCollumn() + "` = ?, `" + LimitTableFields.type limitsStatement = conn.prepareStatement("UPDATE `" + DBTables.LimitsTable.getTableName() + "` SET `" + LimitTableFields.typeid.getCollumn() + "` = ? WHERE `" + LimitTableFields.type.getCollumn() + "` = ?;");
.getCollumn() + "` = ? WHERE `" + LimitTableFields.type.getCollumn() + "` = ?;");
for (CurrencyType type : CurrencyType.values()) { for (CurrencyType type : CurrencyType.values()) {
limitsStatement.setInt(1, type.getId()); limitsStatement.setInt(1, type.getId());
limitsStatement.setString(2, ""); limitsStatement.setString(2, type.getName());
limitsStatement.setString(3, type.getName());
limitsStatement.execute(); limitsStatement.execute();
} }
} catch (SQLException e) { } catch (SQLException e) {