Class KeepOneDedupeStrategy
- java.lang.Object
-
- com.atlassian.confluence.internal.upgrade.constraint.dedup.KeepOneDedupeStrategy
-
- All Implemented Interfaces:
DedupeStrategy
- Direct Known Subclasses:
KeepBiggestIdDedupeStrategy
,KeepSmallestIdDedupeStrategy
public abstract class KeepOneDedupeStrategy extends Object implements DedupeStrategy
Keep only one record. Delete the rest.- Since:
- 7.1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Object
getIdToKeep(SortedSet<Object> ids)
void
perform(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, SortedSet<Object> ids)
Remove duplicates so a unique constraint can be added
-
-
-
Method Detail
-
perform
public void perform(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, SortedSet<Object> ids) throws UpgradeException
Description copied from interface:DedupeStrategy
Remove duplicates so a unique constraint can be added- Specified by:
perform
in interfaceDedupeStrategy
- Parameters:
jdbcTemplate
- AJdbcTemplate
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 inSortedSet
.- Throws:
UpgradeException
- Thrown if there is any error removing duplicates, will cancel the constraint adding process
-
-