diff -r fb30f7b78f9b -r 58f78f0142e8 src/main/java/de/uapcore/lightpit/dao/ModuleDao.java --- a/src/main/java/de/uapcore/lightpit/dao/ModuleDao.java Sat May 09 14:37:15 2020 +0200 +++ b/src/main/java/de/uapcore/lightpit/dao/ModuleDao.java Sat May 09 14:58:20 2020 +0200 @@ -50,6 +50,7 @@ mod.setModID(result.getInt("modid")); mod.setClassname(result.getString("classname")); mod.setVisible(result.getBoolean("visible")); + mod.setPriority(result.getInt("priority")); } @@ -68,21 +69,22 @@ protected PreparedStatement moduleCheckStatement(Connection conn) throws SQLException { return conn.prepareStatement("SELECT visible FROM lpitcore_module WHERE classname = ?"); } - + /** * Must return a prepared statement for insertion with the specified properties. - * + * * - * + * * @param conn the connection to use * @return the prepared statement - * @throws SQLException + * @throws SQLException */ protected PreparedStatement moduleInsertStatement(Connection conn) throws SQLException { - return conn.prepareStatement("INSERT INTO lpitcore_module (classname, visible) VALUES (?, ?)"); + return conn.prepareStatement("INSERT INTO lpitcore_module (classname, visible, priority) VALUES (?, ?, ?)"); } /** @@ -110,6 +112,7 @@ try (ResultSet r = check.executeQuery()) { if (!r.next()) { insert.setString(1, modEntry.getKey()); + insert.setInt(3, modEntry.getValue().defaultPriority()); insert.executeUpdate(); } }