Correctif dans le code du modèle de donnée

This commit is contained in:
Marc Baloup 2015-03-08 01:54:07 -05:00
parent 44a07d9511
commit 588d914feb
3 changed files with 13 additions and 3 deletions

View File

@ -19,6 +19,15 @@ public class ModoHistoryElement extends SQLElement {
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() {
return new String[] {

View File

@ -27,6 +27,7 @@ public class ModoHistoryTable extends SQLTable<ModoHistoryElement> {
@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"),

View File

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