summaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/jpa/dao/RulesDao.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/sonar-core/src/main/java/org/sonar/jpa/dao/RulesDao.java b/sonar-core/src/main/java/org/sonar/jpa/dao/RulesDao.java
index 736d977ac30..8cb5151c7f5 100644
--- a/sonar-core/src/main/java/org/sonar/jpa/dao/RulesDao.java
+++ b/sonar-core/src/main/java/org/sonar/jpa/dao/RulesDao.java
@@ -41,13 +41,20 @@ public class RulesDao extends BaseDao {
return getSession().getResults(Rule.class, "enabled", true);
}
- public List<Rule> getRulesByPlugin(String pluginKey) {
- return getSession().getResults(Rule.class, "pluginName", pluginKey, "enabled", true);
+ public List<Rule> getRulesByRepository(String repositoryKey) {
+ return getSession().getResults(Rule.class, "pluginName", repositoryKey, "enabled", true);
}
+ /**
+ * @deprecated since 2.5 use {@link #getRulesByRepository(String)} instead.
+ */
+ @Deprecated
+ public List<Rule> getRulesByPlugin(String pluginKey) {
+ return getRulesByRepository(pluginKey);
+ }
- public Rule getRuleByKey(String pluginKey, String ruleKey) {
- return getSession().getSingleResult(Rule.class, "key", ruleKey, "pluginName", pluginKey, "enabled", true);
+ public Rule getRuleByKey(String repositoryKey, String ruleKey) {
+ return getSession().getSingleResult(Rule.class, "key", ruleKey, "pluginName", repositoryKey, "enabled", true);
}
public Long countRules(List<String> plugins) {
@@ -57,7 +64,6 @@ public class RulesDao extends BaseDao {
getSingleResult();
}
-
public List<RuleParam> getRuleParams() {
return getSession().getResults(RuleParam.class);
}