void deleteAnalyses(String rootUuid) {
profiler.start("deleteAnalyses (events)");
- purgeMapper.deleteComponentEvents(rootUuid);
+ purgeMapper.deleteEventsByComponentUuid(rootUuid);
session.commit();
profiler.stop();
void deletePermissions(long rootId) {
profiler.start("deletePermissions (group_roles)");
- purgeMapper.deleteComponentGroupRoles(rootId);
+ purgeMapper.deleteGroupRolesByComponentId(rootId);
session.commit();
profiler.stop();
profiler.start("deletePermissions (user_roles)");
- purgeMapper.deleteComponentUserRoles(rootId);
+ purgeMapper.deleteUserRolesByComponentId(rootId);
session.commit();
profiler.stop();
}
void deleteIssues(String rootUuid) {
profiler.start("deleteIssues (issue_changes)");
- purgeMapper.deleteComponentIssueChanges(rootUuid);
+ purgeMapper.deleteIssueChangesByProjectUuid(rootUuid);
session.commit();
profiler.stop();
profiler.start("deleteIssues (issues)");
- purgeMapper.deleteComponentIssues(rootUuid);
+ purgeMapper.deleteIssuesByProjectUuid(rootUuid);
session.commit();
profiler.stop();
}
void deleteLinks(String rootUuid) {
profiler.start("deleteLinks (project_links)");
- purgeMapper.deleteComponentLinks(rootUuid);
+ purgeMapper.deleteProjectLinksByComponentUuid(rootUuid);
session.commit();
profiler.stop();
}
List<List<String>> uuidsPartitions = Lists.partition(IdUuidPairs.uuids(rootAndModulesOrSubviewsIds), MAX_RESOURCES_PER_QUERY);
profiler.start("deleteByRootAndModulesOrSubviews (properties)");
- idPartitions.forEach(purgeMapper::deleteComponentProperties);
+ idPartitions.forEach(purgeMapper::deletePropertiesByComponentIds);
session.commit();
profiler.stop();
profiler.start("deleteByRootAndModulesOrSubviews (manual_measures)");
- uuidsPartitions.forEach(purgeMapper::deleteComponentManualMeasures);
+ uuidsPartitions.forEach(purgeMapper::deleteManualMeasuresByComponentUuids);
session.commit();
profiler.stop();
}
void deleteComponents(String rootUuid) {
profiler.start("deleteComponents (projects)");
- purgeMapper.deleteComponents(rootUuid);
+ purgeMapper.deleteComponentsByProjectUuid(rootUuid);
session.commit();
profiler.stop();
}
PurgeMapper mapper = mapper(session);
executeLargeInputs(conf.getDisabledComponentUuids(),
input -> {
- mapper.deleteFileSourcesByUuid(input);
+ mapper.deleteFileSourcesByFileUuid(input);
mapper.resolveComponentIssuesNotAlreadyResolved(input, system2.now());
return emptyList();
});
void resolveComponentIssuesNotAlreadyResolved(@Param("componentUuids") List<String> componentUuids, @Param("dateAsLong") Long dateAsLong);
- void deleteComponentLinks(@Param("rootUuid") String rootUuid);
+ void deleteProjectLinksByComponentUuid(@Param("rootUuid") String rootUuid);
- void deleteComponentProperties(@Param("componentIds") List<Long> componentIds);
+ void deletePropertiesByComponentIds(@Param("componentIds") List<Long> componentIds);
- void deleteComponents(@Param("rootUuid") String rootUuid);
+ void deleteComponentsByProjectUuid(@Param("rootUuid") String rootUuid);
- void deleteComponentGroupRoles(@Param("rootId") long rootId);
+ void deleteGroupRolesByComponentId(@Param("rootId") long rootId);
- void deleteComponentUserRoles(@Param("rootId") long rootId);
+ void deleteUserRolesByComponentId(@Param("rootId") long rootId);
- void deleteComponentManualMeasures(@Param("componentUuids") List<String> componentUuids);
+ void deleteManualMeasuresByComponentUuids(@Param("componentUuids") List<String> componentUuids);
- void deleteComponentEvents(@Param("componentUuid") String componentUuid);
+ void deleteEventsByComponentUuid(@Param("componentUuid") String componentUuid);
List<PurgeableAnalysisDto> selectPurgeableAnalysesWithEvents(@Param("componentUuid") String componentUuid);
List<PurgeableAnalysisDto> selectPurgeableAnalysesWithoutEvents(@Param("componentUuid") String componentUuid);
- void deleteComponentIssueChanges(@Param("rootUuid") String rootUuid);
+ void deleteIssueChangesByProjectUuid(@Param("projectUuid") String projectUuid);
- void deleteComponentIssues(@Param("rootUuid") String rootUuid);
+ void deleteIssuesByProjectUuid(@Param("projectUuid") String projectUuid);
List<String> selectOldClosedIssueKeys(@Param("projectUuid") String projectUuid, @Nullable @Param("toDate") Long toDate);
void deleteFileSourcesByProjectUuid(String rootProjectUuid);
- void deleteFileSourcesByUuid(@Param("fileUuids") List<String> fileUuids);
+ void deleteFileSourcesByFileUuid(@Param("fileUuids") List<String> fileUuids);
void deleteCeActivityByProjectUuid(@Param("projectUuid") String projectUuid);
and resolution is null
</update>
- <delete id="deleteComponentLinks" parameterType="map">
+ <delete id="deleteProjectLinksByComponentUuid" parameterType="map">
delete from project_links
where
component_uuid = #{rootUuid,jdbcType=VARCHAR}
</delete>
- <delete id="deleteComponentProperties" parameterType="map">
+ <delete id="deletePropertiesByComponentIds" parameterType="map">
delete from properties
where
resource_id in
</foreach>
</delete>
- <delete id="deleteComponents" parameterType="map">
+ <delete id="deleteComponentsByProjectUuid" parameterType="map">
delete from projects
where
project_uuid = #{rootUuid,jdbcType=VARCHAR}
</delete>
- <delete id="deleteComponentGroupRoles" parameterType="map">
+ <delete id="deleteGroupRolesByComponentId" parameterType="map">
delete from group_roles
where
resource_id = #{rootId,jdbcType=INTEGER}
</delete>
- <delete id="deleteComponentUserRoles" parameterType="map">
+ <delete id="deleteUserRolesByComponentId" parameterType="map">
delete from user_roles
where
resource_id = #{rootId,jdbcType=INTEGER}
</delete>
- <delete id="deleteComponentManualMeasures" parameterType="map">
+ <delete id="deleteManualMeasuresByComponentUuids" parameterType="map">
delete from manual_measures where component_uuid in
<foreach collection="componentUuids" open="(" close=")" item="componentUuid" separator=",">
#{componentUuid,jdbcType=VARCHAR}
</foreach>
</delete>
- <delete id="deleteComponentEvents" parameterType="map">
+ <delete id="deleteEventsByComponentUuid" parameterType="map">
delete from events
where
component_uuid = #{componentUuid,jdbcType=VARCHAR}
</delete>
- <delete id="deleteComponentIssueChanges" parameterType="map">
+ <delete id="deleteIssueChangesByProjectUuid" parameterType="map">
delete from issue_changes ic
where
- exists (select 1 from issues i where i.kee=ic.issue_key and i.project_uuid = #{rootUuid,jdbcType=VARCHAR})
+ exists (select 1 from issues i where i.kee=ic.issue_key and i.project_uuid = #{projectUuid,jdbcType=VARCHAR})
</delete>
<!-- Mssql -->
- <delete id="deleteComponentIssueChanges" databaseId="mssql" parameterType="map">
+ <delete id="deleteIssueChangesByProjectUuid" databaseId="mssql" parameterType="map">
delete issue_changes from issue_changes
inner join issues on
issue_changes.issue_key=issues.kee
where
- issues.project_uuid = #{rootUuid,jdbcType=VARCHAR}
+ issues.project_uuid = #{projectUuid,jdbcType=VARCHAR}
</delete>
<!-- Mysql -->
- <delete id="deleteComponentIssueChanges" databaseId="mysql" parameterType="map">
+ <delete id="deleteIssueChangesByProjectUuid" databaseId="mysql" parameterType="map">
delete ic from issue_changes as ic, issues as i
where
ic.issue_key=i.kee
- and i.component_uuid = #{rootUuid,jdbcType=VARCHAR}
+ and i.component_uuid = #{projectUuid,jdbcType=VARCHAR}
</delete>
- <delete id="deleteComponentIssues" parameterType="map">
+ <delete id="deleteIssuesByProjectUuid" parameterType="map">
delete from issues
- where project_uuid = #{rootUuid,jdbcType=VARCHAR}
+ where project_uuid = #{projectUuid,jdbcType=VARCHAR}
</delete>
<delete id="deleteFileSourcesByProjectUuid">
delete from file_sources where project_uuid=#{rootProjectUuid,jdbcType=VARCHAR}
</delete>
- <delete id="deleteFileSourcesByUuid">
+ <delete id="deleteFileSourcesByFileUuid">
delete from file_sources
where
file_uuid in