From 588d914feb175e758e3b63a3eb377c48f40e4516 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Sun, 8 Mar 2015 01:54:07 -0500 Subject: [PATCH] =?UTF-8?q?Correctif=20dans=20le=20code=20du=20mod=C3=A8le?= =?UTF-8?q?=20de=20donn=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pandacraftutils/data_model/ModoHistoryElement.java | 9 +++++++++ .../pandacraftutils/data_model/ModoHistoryTable.java | 1 + .../plugin/pandacraftutils/data_model/SQLElement.java | 6 +++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/ModoHistoryElement.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/ModoHistoryElement.java index 1484a78..303f4cb 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/ModoHistoryElement.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/ModoHistoryElement.java @@ -18,6 +18,15 @@ public class ModoHistoryElement extends SQLElement { setPlayerName(player); setMessage(message); } + + ModoHistoryElement(int id, String modo, ActionType type, long time, String player, String message) { + super("pandacraft_modo_history", id); + setModoName(modo); + setActionType(type); + setTime(time); + setPlayerName(player); + setMessage(message); + } @Override protected String[] getValues() { diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/ModoHistoryTable.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/ModoHistoryTable.java index 7c48d28..36ae286 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/ModoHistoryTable.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/ModoHistoryTable.java @@ -27,6 +27,7 @@ public class ModoHistoryTable extends SQLTable { @Override protected ModoHistoryElement getElementInstance(ResultSet sqlResult) throws SQLException { ModoHistoryElement el = new ModoHistoryElement( + sqlResult.getInt("id"), sqlResult.getString("modoName"), ActionType.valueOf(sqlResult.getString("actionType")), sqlResult.getLong("time"), diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/SQLElement.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/SQLElement.java index 260efc4..f6aaa84 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/SQLElement.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/SQLElement.java @@ -23,14 +23,14 @@ public abstract class SQLElement { - public SQLElement(String name) { + protected SQLElement(String name) { this(name, 0); } - public SQLElement(String name, int id) { + protected SQLElement(String name, int id) { tableName = name; this.id = id; - + saved = true; }