From: Julien Lancelot Date: Mon, 24 Mar 2014 12:28:04 +0000 (+0100) Subject: SONAR-5121 Add restore from XMl actions X-Git-Tag: 4.3~304 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=15f82899fb01062f6fe511ca4f18e1aa55690d47;p=sonarqube.git SONAR-5121 Add restore from XMl actions --- diff --git a/sonar-core/src/main/java/org/sonar/core/rule/RuleDao.java b/sonar-core/src/main/java/org/sonar/core/rule/RuleDao.java index 74878a71ff6..b0ea59de07e 100644 --- a/sonar-core/src/main/java/org/sonar/core/rule/RuleDao.java +++ b/sonar-core/src/main/java/org/sonar/core/rule/RuleDao.java @@ -53,12 +53,16 @@ public class RuleDao implements BatchComponent, ServerComponent { public List selectEnablesAndNonManual() { SqlSession session = mybatis.openSession(); try { - return getMapper(session).selectEnablesAndNonManual(); + return selectEnablesAndNonManual(session); } finally { MyBatis.closeQuietly(session); } } + public List selectEnablesAndNonManual(SqlSession session) { + return getMapper(session).selectEnablesAndNonManual(); + } + public List selectNonManual(SqlSession session) { return getMapper(session).selectNonManual(); } @@ -76,19 +80,6 @@ public class RuleDao implements BatchComponent, ServerComponent { return getMapper(session).selectBySubCharacteristicId(characteristicOrSubCharacteristicId); } - public List selectOverridingDebt(List repositories) { - SqlSession session = mybatis.openSession(); - try { - return selectOverridingDebt(repositories, session); - } finally { - MyBatis.closeQuietly(session); - } - } - - public List selectOverridingDebt(List repositories, SqlSession session) { - return getMapper(session).selectOverridingDebt(repositories); - } - @CheckForNull public RuleDto selectById(Integer id, SqlSession session) { return getMapper(session).selectById(id); diff --git a/sonar-core/src/main/java/org/sonar/core/rule/RuleMapper.java b/sonar-core/src/main/java/org/sonar/core/rule/RuleMapper.java index 5976f9c2dd2..920b825c138 100644 --- a/sonar-core/src/main/java/org/sonar/core/rule/RuleMapper.java +++ b/sonar-core/src/main/java/org/sonar/core/rule/RuleMapper.java @@ -32,8 +32,6 @@ public interface RuleMapper { List selectBySubCharacteristicId(int characteristicId); - List selectOverridingDebt(@Param("repositories") List repositories); - RuleDto selectById(Integer id); RuleDto selectByName(String name); diff --git a/sonar-core/src/main/java/org/sonar/core/technicaldebt/db/CharacteristicDao.java b/sonar-core/src/main/java/org/sonar/core/technicaldebt/db/CharacteristicDao.java index 355442d90ac..59a84d38c03 100644 --- a/sonar-core/src/main/java/org/sonar/core/technicaldebt/db/CharacteristicDao.java +++ b/sonar-core/src/main/java/org/sonar/core/technicaldebt/db/CharacteristicDao.java @@ -146,38 +146,6 @@ public class CharacteristicDao implements BatchComponent, ServerComponent { return session.getMapper(CharacteristicMapper.class).selectByName(name); } - @CheckForNull - public CharacteristicDto selectNext(int order, SqlSession session) { - List dtos = session.getMapper(CharacteristicMapper.class).selectNext(order); - return dtos.isEmpty() ? null : dtos.get(0); - } - - @CheckForNull - public CharacteristicDto selectNext(int order) { - SqlSession session = mybatis.openSession(); - try { - return selectNext(order, session); - } finally { - MyBatis.closeQuietly(session); - } - } - - @CheckForNull - public CharacteristicDto selectPrevious(int order, SqlSession session) { - List dtos = session.getMapper(CharacteristicMapper.class).selectPrevious(order); - return dtos.isEmpty() ? null : dtos.get(0); - } - - @CheckForNull - public CharacteristicDto selectPrevious(int order) { - SqlSession session = mybatis.openSession(); - try { - return selectPrevious(order, session); - } finally { - MyBatis.closeQuietly(session); - } - } - public int selectMaxCharacteristicOrder() { SqlSession session = mybatis.openSession(); try { diff --git a/sonar-core/src/main/java/org/sonar/core/technicaldebt/db/CharacteristicMapper.java b/sonar-core/src/main/java/org/sonar/core/technicaldebt/db/CharacteristicMapper.java index 2767ef3eb77..910f2df84b0 100644 --- a/sonar-core/src/main/java/org/sonar/core/technicaldebt/db/CharacteristicMapper.java +++ b/sonar-core/src/main/java/org/sonar/core/technicaldebt/db/CharacteristicMapper.java @@ -38,10 +38,6 @@ public interface CharacteristicMapper { CharacteristicDto selectByName(String name); - List selectNext(int order); - - List selectPrevious(int order); - Integer selectMaxCharacteristicOrder(); void insert(CharacteristicDto characteristic); diff --git a/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml b/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml index 16d37d6a426..c376bb984eb 100644 --- a/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml @@ -64,19 +64,6 @@ - - UPDATE rules SET plugin_rule_key=#{ruleKey}, diff --git a/sonar-core/src/main/resources/org/sonar/core/technicaldebt/db/CharacteristicMapper.xml b/sonar-core/src/main/resources/org/sonar/core/technicaldebt/db/CharacteristicMapper.xml index 5a600667933..0bae9e151fd 100644 --- a/sonar-core/src/main/resources/org/sonar/core/technicaldebt/db/CharacteristicMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/technicaldebt/db/CharacteristicMapper.xml @@ -74,28 +74,6 @@ - - - -