profiler.stop();
}
+ void deleteLinks(String rootUuid) {
+ profiler.start("deleteLinks (project_links)");
+ purgeMapper.deleteComponentLinks(rootUuid);
+ session.commit();
+ profiler.stop();
+ }
+
void deleteComponents(List<IdUuidPair> componentIdUuids) {
List<List<Long>> componentIdPartitions = Lists.partition(IdUuidPairs.ids(componentIdUuids), MAX_RESOURCES_PER_QUERY);
List<List<String>> componentUuidsPartitions = Lists.partition(IdUuidPairs.uuids(componentIdUuids), MAX_RESOURCES_PER_QUERY);
// possible missing optimization: filter requests according to resource scope
- profiler.start("deleteResourceLinks (project_links)");
- componentUuidsPartitions.forEach(purgeMapper::deleteComponentLinks);
- session.commit();
- profiler.stop();
-
profiler.start("deleteResourceProperties (properties)");
componentIdPartitions.forEach(purgeMapper::deleteComponentProperties);
session.commit();
.findFirst()
.orElseThrow(() -> new IllegalStateException("Couldn't find component for root uuid " + rootUuid));
commands.deletePermissions(rootId);
+ commands.deleteLinks(rootUuid);
commands.deleteAnalyses(rootUuid);
commands.deleteComponents(childrenIds);
commands.deleteIssues(rootUuid);
void resolveComponentIssuesNotAlreadyResolved(@Param("componentUuids") List<String> componentUuids, @Param("dateAsLong") Long dateAsLong);
- void deleteComponentLinks(@Param("componentUuids") List<String> componentUuids);
+ void deleteComponentLinks(@Param("rootUuid") String rootUuid);
void deleteComponentProperties(@Param("componentIds") List<Long> componentIds);
<delete id="deleteComponentLinks" parameterType="map">
delete from project_links
where
- component_uuid in
- <foreach collection="componentUuids" open="(" close=")" item="componentUuid" separator=",">
- #{componentUuid,jdbcType=VARCHAR}
- </foreach>
+ component_uuid = #{rootUuid,jdbcType=VARCHAR}
</delete>
<delete id="deleteComponentProperties" parameterType="map">