diff --git a/src/main/java/org/gridsuite/modification/server/migration/ModificationOrderMigration.java b/src/main/java/org/gridsuite/modification/server/migration/ModificationOrderMigration.java index e5c890a86..34af4075c 100644 --- a/src/main/java/org/gridsuite/modification/server/migration/ModificationOrderMigration.java +++ b/src/main/java/org/gridsuite/modification/server/migration/ModificationOrderMigration.java @@ -11,6 +11,8 @@ import liquibase.statement.SqlStatement; import liquibase.statement.core.UpdateStatement; import org.apache.commons.lang3.tuple.Pair; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -25,6 +27,8 @@ */ public class ModificationOrderMigration implements CustomSqlChange { + private static final Logger LOGGER = LoggerFactory.getLogger(ModificationOrderMigration.class); + @Override public SqlStatement[] generateStatements(Database database) throws CustomChangeException { JdbcConnection connection = (JdbcConnection) database.getConnection(); @@ -58,8 +62,8 @@ private void reorderNetworkModifications(UUID groupId, boolean stashed, JdbcConn } private List findAllByGroupId(UUID groupId, boolean stashed, JdbcConnection connection) throws CustomChangeException { - try (PreparedStatement stmt = connection.prepareStatement("SELECT id FROM modification m WHERE m.group_id = '?' AND m.stashed = ? order by modifications_order")) { - stmt.setString(1, groupId.toString()); + try (PreparedStatement stmt = connection.prepareStatement("SELECT id FROM modification m WHERE m.group_id = ? AND m.stashed = ? order by modifications_order")) { + stmt.setObject(1, groupId); stmt.setBoolean(2, stashed); ResultSet resultSet = stmt.executeQuery(); List entities = new ArrayList<>(); @@ -85,12 +89,12 @@ public String getConfirmationMessage() { @Override public void setUp() throws SetupException { - + LOGGER.info("Set up migration for modification order"); } @Override public void setFileOpener(ResourceAccessor resourceAccessor) { - + LOGGER.info("Set file opener for modification order"); } @Override