From: Dejan Milisavljevic Date: Thu, 10 Oct 2024 14:21:04 +0000 (+0200) Subject: SONAR-23250 Initial population of active_rules with impacts X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5038a353ca5917a647e5613859fbf62e756f4a21;p=sonarqube.git SONAR-23250 Initial population of active_rules with impacts --- diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleDao.java index 4e6501a043d..e085a3cc315 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleDao.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleDao.java @@ -68,6 +68,10 @@ public class ActiveRuleDao implements Dao { return mapper(dbSession).selectByRuleUuid(ruleUuid); } + public List selectByRepository(DbSession dbSession, String repositoryKey, String repositoryLanguage) { + return mapper(dbSession).selectByRepository(repositoryKey, repositoryLanguage); + } + public List selectByRuleUuids(DbSession dbSession, List uuids) { return executeLargeInputs(uuids, chunk -> mapper(dbSession).selectByRuleUuids(chunk)); } diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleMapper.java index 1e276615f37..d2b2dddfdbe 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleMapper.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleMapper.java @@ -47,6 +47,9 @@ public interface ActiveRuleMapper { List selectByRuleUuid(String ruleUuid); + List selectByRepository(@Param("repositoryKey") String repositoryKey, + @Param("repositoryLanguage") String repositoryLanguage); + List selectByRuleUuids(@Param("ruleUuids") List partitionOfRuleUuids); List selectByProfileUuid(String uuid); diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/ActiveRuleMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/ActiveRuleMapper.xml index 92a9b7fca53..10442858528 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/ActiveRuleMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/ActiveRuleMapper.xml @@ -201,6 +201,16 @@ r.uuid = #{ruleUuid, jdbcType=VARCHAR} + +