public class MergeToSmallestIdDedupeStrategy extends KeepSmallestIdDedupeStrategy
| Modifier and Type | Class and Description |
|---|---|
static class |
MergeToSmallestIdDedupeStrategy.ReferencedTable
Hold information about a table having a foreign key referencing current table
This implementation only support simple foreign keys i.e.
|
| Constructor and Description |
|---|
MergeToSmallestIdDedupeStrategy(String table,
String idColumn,
Collection<MergeToSmallestIdDedupeStrategy.ReferencedTable> referencedTables) |
| Modifier and Type | Method and Description |
|---|---|
void |
perform(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate,
SortedSet<Object> ids)
Remove duplicates so a unique constraint can be added
|
getIdToKeeppublic MergeToSmallestIdDedupeStrategy(String table, String idColumn, Collection<MergeToSmallestIdDedupeStrategy.ReferencedTable> referencedTables)
public void perform(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate,
SortedSet<Object> ids)
throws UpgradeException
DedupeStrategyperform in interface DedupeStrategyperform in class KeepOneDedupeStrategyjdbcTemplate - A JdbcTemplate to be usedids - Set of Ids of duplicate rows in DB. Upon invocation of this method, only one of them can remain in the DB.
All Confluence primary keys are of type Long or String so they can be used in SortedSet.UpgradeException - Thrown if there is any error removing duplicates, will cancel the constraint adding processCopyright © 2003–2022 Atlassian. All rights reserved.