aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-06-11 12:05:02 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-06-11 13:35:32 +0200
commit433993d355aa6da5914a0cd525659748aa741ce3 (patch)
treea5e08b45c68df971c97426e65dde36148ddef8a6 /sonar-core
parentca373f36b8517d938c0a9c8d27d484c33ab988f5 (diff)
downloadsonarqube-433993d355aa6da5914a0cd525659748aa741ce3.tar.gz
sonarqube-433993d355aa6da5914a0cd525659748aa741ce3.zip
SONAR-5007 remove unused methods in Q profile DAOs
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleMapper.java14
-rw-r--r--sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDao.java13
-rw-r--r--sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileMapper.java2
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/ActiveRuleMapper.xml34
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/QualityProfileMapper.xml9
-rw-r--r--sonar-core/src/test/java/org/sonar/core/qualityprofile/db/QualityProfileDaoTest.java7
6 files changed, 0 insertions, 79 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleMapper.java b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleMapper.java
index 5c2396d459b..71cd5ba0722 100644
--- a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleMapper.java
+++ b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleMapper.java
@@ -33,16 +33,9 @@ public interface ActiveRuleMapper {
void delete(int activeRuleId);
- void deleteFromRule(int ruleId);
-
- void deleteFromProfile(int profileId);
-
@CheckForNull
ActiveRuleDto selectById(Integer id);
- @CheckForNull
- ActiveRuleDto selectByProfileAndRule(@Param("profileId") int profileId, @Param("ruleId") int ruleId);
-
List<ActiveRuleDto> selectByRuleId(int ruleId);
List<ActiveRuleDto> selectByProfileId(int profileId);
@@ -59,13 +52,6 @@ public interface ActiveRuleMapper {
void deleteParameter(int activeRuleParamId);
- void deleteParametersWithParamId(int id);
-
- void deleteParametersFromProfile(int profileId);
-
- @CheckForNull
- ActiveRuleParamDto selectParamById(int activeRuleParamId);
-
@CheckForNull
ActiveRuleParamDto selectParamByActiveRuleAndKey(@Param("activeRuleId") int activeRuleId, @Param("key") String key);
diff --git a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDao.java b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDao.java
index 5482369922f..8cf36f15f61 100644
--- a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDao.java
+++ b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDao.java
@@ -271,19 +271,6 @@ public class QualityProfileDao implements ServerComponent, DaoComponent {
}
}
- public int countChildren(String name, String language, DbSession session) {
- return session.getMapper(QualityProfileMapper.class).countChildren(name, language);
- }
-
- public int countChildren(String name, String language) {
- DbSession session = mybatis.openSession(false);
- try {
- return countChildren(name, language, session);
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
/**
* @deprecated Replaced by
* {@link #getByKey(org.sonar.core.persistence.DbSession, QualityProfileKey)}
diff --git a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileMapper.java b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileMapper.java
index ae4b6b3e387..547ad9d8cb6 100644
--- a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileMapper.java
+++ b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileMapper.java
@@ -55,8 +55,6 @@ public interface QualityProfileMapper {
List<QualityProfileDto> selectChildren(@Param("name") String name, @Param("language") String language);
- int countChildren(@Param("name") String name, @Param("language") String language);
-
// PROJECTS
List<ComponentDto> selectProjects(@Param("value") String propertyValue, @Param("key") String propertyKey);
diff --git a/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/ActiveRuleMapper.xml b/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/ActiveRuleMapper.xml
index bdd5c15f66b..4da154a4226 100644
--- a/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/ActiveRuleMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/ActiveRuleMapper.xml
@@ -67,14 +67,6 @@
DELETE FROM active_rules WHERE id=#{id}
</update>
- <update id="deleteFromRule" parameterType="Integer">
- DELETE FROM active_rules WHERE rule_id=#{ruleId}
- </update>
-
- <update id="deleteFromProfile" parameterType="Integer">
- DELETE FROM active_rules WHERE profile_id=#{profileId}
- </update>
-
<select id="selectByIds" parameterType="map" resultType="ActiveRule">
select
<include refid="activeRuleColumns"/>
@@ -118,16 +110,6 @@
AND qp.language = #{lang}
</select>
- <select id="selectByProfileAndRule" parameterType="map" resultType="ActiveRule">
- SELECT <include refid="activeRuleColumns"/>
- FROM active_rules a
- <include refid="activeRuleJoin"/>
- <where>
- AND a.profile_id=#{profileId}
- AND a.rule_id=#{ruleId}
- </where>
- </select>
-
<select id="selectByRuleId" parameterType="Integer" resultType="ActiveRule">
SELECT
<include refid="activeRuleKeyColumns"/>
@@ -180,26 +162,10 @@
DELETE FROM active_rule_parameters WHERE active_rule_id=#{id}
</update>
- <update id="deleteParametersWithParamId" parameterType="Integer">
- DELETE FROM active_rule_parameters WHERE rules_parameter_id=#{id}
- </update>
-
- <update id="deleteParametersFromProfile" parameterType="Integer">
- DELETE FROM active_rule_parameters WHERE active_rule_id IN (SELECT id FROM active_rules WHERE profile_id=#{profileId})
- </update>
-
<update id="deleteParameter" parameterType="Integer">
DELETE FROM active_rule_parameters WHERE id=#{id}
</update>
- <select id="selectParamById" parameterType="Integer" resultType="ActiveRuleParam">
- SELECT <include refid="activeRuleParamColumns"/>
- FROM active_rule_parameters p
- <where>
- AND p.id=#{id}
- </where>
- </select>
-
<select id="selectParamsByActiveRuleId" parameterType="Integer" resultType="ActiveRuleParam">
select
<include refid="activeRuleParamColumns"/>
diff --git a/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/QualityProfileMapper.xml b/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/QualityProfileMapper.xml
index a764f207187..370eb6b006a 100644
--- a/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/QualityProfileMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/QualityProfileMapper.xml
@@ -79,15 +79,6 @@
ORDER BY p.name
</select>
- <select id="countChildren" parameterType="map" resultType="Integer">
- SELECT count(p.id)
- FROM rules_profiles p
- <where>
- AND p.parent_name=#{name}
- AND p.language=#{language}
- </where>
- </select>
-
<select id="selectDefaultProfile" parameterType="Integer" resultType="QualityProfile">
SELECT <include refid="profilesColumns"/>
FROM rules_profiles p
diff --git a/sonar-core/src/test/java/org/sonar/core/qualityprofile/db/QualityProfileDaoTest.java b/sonar-core/src/test/java/org/sonar/core/qualityprofile/db/QualityProfileDaoTest.java
index e62ce0abdce..d539ddc9e08 100644
--- a/sonar-core/src/test/java/org/sonar/core/qualityprofile/db/QualityProfileDaoTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/qualityprofile/db/QualityProfileDaoTest.java
@@ -203,13 +203,6 @@ public class QualityProfileDaoTest extends AbstractDaoTestCase {
}
@Test
- public void count_children() {
- setupData("inheritance");
-
- assertThat(dao.countChildren("Parent", "java")).isEqualTo(2);
- }
-
- @Test
public void select_projects() {
setupData("projects");