aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2018-04-17 13:36:39 +0200
committerSonarTech <sonartech@sonarsource.com>2018-05-10 20:20:52 +0200
commitf716dca60b060d4386a1bd9c54f0ef7c2df10c0c (patch)
treeb4fe72f33bac741cccb4fa1f15b4aace4bb0310e /server/sonar-db-dao
parente17a524905b6b0408172841c0aa8423532afd9ba (diff)
downloadsonarqube-f716dca60b060d4386a1bd9c54f0ef7c2df10c0c.tar.gz
sonarqube-f716dca60b060d4386a1bd9c54f0ef7c2df10c0c.zip
SONAR-10594 remove unused RuleRepositoryDao#selectByKey()
Diffstat (limited to 'server/sonar-db-dao')
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleRepositoryDao.java5
-rw-r--r--server/sonar-db-dao/src/main/resources/org/sonar/db/rule/RuleRepositoryMapper.xml6
-rw-r--r--server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleRepositoryDaoTest.java10
3 files changed, 0 insertions, 21 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleRepositoryDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleRepositoryDao.java
index 4e1d4563ae0..1d9775d8a3e 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleRepositoryDao.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleRepositoryDao.java
@@ -21,7 +21,6 @@ package org.sonar.db.rule;
import java.util.Collection;
import java.util.List;
-import java.util.Optional;
import org.sonar.api.utils.System2;
import org.sonar.db.Dao;
import org.sonar.db.DbSession;
@@ -50,10 +49,6 @@ public class RuleRepositoryDao implements Dao {
return dbSession.getMapper(RuleRepositoryMapper.class).selectByLanguage(language);
}
- public Optional<RuleRepositoryDto> selectByKey(DbSession dbSession, String key) {
- return Optional.ofNullable(dbSession.getMapper(RuleRepositoryMapper.class).selectByKey(key));
- }
-
public void truncate(DbSession dbSession) {
dbSession.getMapper(RuleRepositoryMapper.class).truncate();
}
diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/rule/RuleRepositoryMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/rule/RuleRepositoryMapper.xml
index 1e9ad4f9889..33596dd920e 100644
--- a/server/sonar-db-dao/src/main/resources/org/sonar/db/rule/RuleRepositoryMapper.xml
+++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/rule/RuleRepositoryMapper.xml
@@ -20,12 +20,6 @@
order by kee
</select>
- <select id="selectByKey" parameterType="String" resultType="org.sonar.db.rule.RuleRepositoryDto">
- select <include refid="sqlColumns"/>
- from rule_repositories
- where kee = #{key}
- </select>
-
<update id="truncate">
delete from rule_repositories
</update>
diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleRepositoryDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleRepositoryDaoTest.java
index 84f7883125f..3e90955f27c 100644
--- a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleRepositoryDaoTest.java
+++ b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleRepositoryDaoTest.java
@@ -89,16 +89,6 @@ public class RuleRepositoryDaoTest {
}
@Test
- public void selectByKey() {
- DbSession dbSession = dbTester.getSession();
- RuleRepositoryDto dto1 = new RuleRepositoryDto("findbugs", "java", "Findbugs");
- underTest.insert(dbSession, asList(dto1));
-
- assertThat(underTest.selectByKey(dbSession, "findbugs").get().getKey()).isEqualTo("findbugs");
- assertThat(underTest.selectByKey(dbSession, "missing")).isNotPresent();
- }
-
- @Test
public void truncate() {
DbSession dbSession = dbTester.getSession();
RuleRepositoryDto dto1 = new RuleRepositoryDto("findbugs", "java", "Findbugs");