]> source.dussan.org Git - sonarqube.git/commitdiff
Remove unused QualityProfileDao methods
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 28 Sep 2016 15:01:24 +0000 (17:01 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 28 Sep 2016 16:07:34 +0000 (18:07 +0200)
sonar-db/src/main/java/org/sonar/db/qualityprofile/QualityProfileDao.java
sonar-db/src/main/java/org/sonar/db/qualityprofile/QualityProfileMapper.java
sonar-db/src/main/resources/org/sonar/db/qualityprofile/QualityProfileMapper.xml
sonar-db/src/test/java/org/sonar/db/qualityprofile/QualityProfileDaoTest.java

index a537fd9d15d335c0a26100cbf56d887881daa674..64e98ccf061fbb9c50d968f393aba742dbdc5f6c 100644 (file)
@@ -237,21 +237,6 @@ public class QualityProfileDao implements Dao {
     }
   }
 
-  @CheckForNull
-  public QualityProfileDto selectParent(DbSession session, String childKey) {
-    return mapper(session).selectParent(childKey);
-  }
-
-  @CheckForNull
-  public QualityProfileDto selectParent(String childKey) {
-    DbSession session = mybatis.openSession(false);
-    try {
-      return selectParent(session, childKey);
-    } finally {
-      MyBatis.closeQuietly(session);
-    }
-  }
-
   @CheckForNull
   public QualityProfileDto selectParentById(DbSession session, int childId) {
     return mapper(session).selectParentById(childId);
@@ -305,15 +290,6 @@ public class QualityProfileDao implements Dao {
     return mapper(session).selectProjects(profileName, language);
   }
 
-  public int countProjects(String profileName, String language) {
-    DbSession session = mybatis.openSession(false);
-    try {
-      return mapper(session).countProjects(profileName, language);
-    } finally {
-      MyBatis.closeQuietly(session);
-    }
-  }
-
   public Map<String, Long> countProjectsByProfileKey() {
     DbSession session = mybatis.openSession(false);
     try {
index fa16136a8c28ece7e61d1886c779d98902f8a6e0..514c61809ebf1c165c8386225577c08e278140b8 100644 (file)
@@ -56,9 +56,6 @@ public interface QualityProfileMapper {
 
   // INHERITANCE
 
-  @CheckForNull
-  QualityProfileDto selectParent(String childKey);
-
   @CheckForNull
   QualityProfileDto selectParentById(int childId);
 
@@ -68,8 +65,6 @@ public interface QualityProfileMapper {
 
   List<ComponentDto> selectProjects(@Param("profileName") String profileName, @Param("language") String language);
 
-  int countProjects(@Param("profileName") String profileName, @Param("language") String language);
-
   List<QualityProfileProjectCount> countProjectsByProfile();
 
   QualityProfileDto selectByProjectIdAndLanguage(@Param("projectId") Long projectId, @Param("language") String language);
index b5a998612c3377fa5cb6534bca89a6b2e7137047..ff59efdc4172372819419efcf0063592ad6a1807 100644 (file)
     WHERE p.id=#{id}
   </select>
 
-  <select id="selectParent" parameterType="string" resultType="QualityProfile">
-    SELECT
-    <include refid="profilesColumns"/>
-    FROM rules_profiles p
-    INNER JOIN rules_profiles child ON child.parent_kee=p.kee AND child.kee=#{id}
-  </select>
-
   <select id="selectParentById" parameterType="int" resultType="QualityProfile">
     SELECT
     <include refid="profilesColumns"/>
     ORDER BY pj.name ASC
   </select>
 
-  <select id="countProjects" parameterType="Integer" resultType="Integer">
-    SELECT count(projects.id)
-    FROM projects projects
-    JOIN project_qprofiles pp ON pp.project_uuid=projects.uuid
-    JOIN rules_profiles prof ON pp.profile_key=prof.kee
-    <where>
-      AND prof.language=#{language}
-      AND prof.name=#{profileName}
-    </where>
-  </select>
-
   <select id="countProjectsByProfile" resultType="org.sonar.db.qualityprofile.QualityProfileProjectCount">
     SELECT pp.profile_key as profileKey, count(projects.id) as projectCount
     FROM projects projects
index bd46312f1f9f90a05fbb7b16738a74c75a02671f..d9bcf4d278f8f092b8acbac29c600243298623ee 100644 (file)
@@ -245,13 +245,6 @@ public class QualityProfileDaoTest {
     assertThat(underTest.selectProjects("Sonar Way", "java")).hasSize(2);
   }
 
-  @Test
-  public void count_projects() {
-    dbTester.prepareDbUnit(getClass(), "projects.xml");
-
-    assertThat(underTest.countProjects("Sonar Way", "java")).isEqualTo(2);
-  }
-
   @Test
   public void count_projects_by_profile() {
     dbTester.prepareDbUnit(getClass(), "projects.xml");