Skip to content

Commit

Permalink
review fix
Browse files Browse the repository at this point in the history
Signed-off-by: Seddik Yengui <[email protected]>
  • Loading branch information
Seddik Yengui committed Dec 24, 2024
1 parent 0687090 commit 00399ff
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -853,14 +853,16 @@ public void deleteIdentifiableList(UUID networkUuid, int variantNum, List<String

try (var connection = dataSource.getConnection()) {
try (var preparedStmt = connection.prepareStatement(QueryCatalog.buildDeleteIdentifiableListQuery(tableName, ids.size()))) {
preparedStmt.setObject(1, networkUuid);
preparedStmt.setInt(2, variantNum);
for (List<String> idsPartition : Lists.partition(ids, BATCH_SIZE)) {
preparedStmt.setObject(1, networkUuid);
preparedStmt.setInt(2, variantNum);

for (int i = 0; i < ids.size(); i++) {
preparedStmt.setString(3 + i, ids.get(i));
}
for (int i = 0; i < idsPartition.size(); i++) {
preparedStmt.setString(3 + i, idsPartition.get(i));
}

preparedStmt.executeUpdate();
preparedStmt.executeUpdate();
}
}
} catch (SQLException e) {
throw new UncheckedSqlException(e);
Expand Down

0 comments on commit 00399ff

Please sign in to comment.