Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
Signed-off-by: Etienne LESOT <[email protected]>
  • Loading branch information
EtienneLt committed Oct 21, 2024
1 parent 9ba1d73 commit df7a531
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down Expand Up @@ -58,8 +62,8 @@ private void reorderNetworkModifications(UUID groupId, boolean stashed, JdbcConn
}

private List<UUID> 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<UUID> entities = new ArrayList<>();
Expand All @@ -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
Expand Down

0 comments on commit df7a531

Please sign in to comment.