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; }