aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-dbcleaner-plugin
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2010-11-29 17:00:54 +0000
committersimonbrandhof <simon.brandhof@gmail.com>2010-11-29 17:00:54 +0000
commit6ce6cc598fdcd6e3d6eb662b47668b0c6b898f3d (patch)
tree0770d083d359e3e644ff64bf06dc8b9abc3ad04b /plugins/sonar-dbcleaner-plugin
parent0c4893c83a6873b224a50db86311082fd5af555f (diff)
downloadsonarqube-6ce6cc598fdcd6e3d6eb662b47668b0c6b898f3d.tar.gz
sonarqube-6ce6cc598fdcd6e3d6eb662b47668b0c6b898f3d.zip
SONAR-249 improve core components to load rules and metrics
Diffstat (limited to 'plugins/sonar-dbcleaner-plugin')
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeRuleMeasures.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeRuleMeasures.java b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeRuleMeasures.java
index d61ad812499..c0eb8f36207 100644
--- a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeRuleMeasures.java
+++ b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/purges/PurgeRuleMeasures.java
@@ -26,9 +26,8 @@ import org.sonar.plugins.dbcleaner.api.Purge;
import org.sonar.plugins.dbcleaner.api.PurgeContext;
import org.sonar.plugins.dbcleaner.api.PurgeUtils;
-import java.util.List;
-
import javax.persistence.Query;
+import java.util.List;
/**
* see SONAR-522
@@ -49,7 +48,7 @@ public final class PurgeRuleMeasures extends Purge {
private void purge(Integer sid) {
Query query = getSession().createQuery("SELECT m.id FROM " + MeasureModel.class.getSimpleName() + " m, " + Snapshot.class.getSimpleName() + " s WHERE s.id = m.snapshotId and " +
- "(s.rootId=:rootSid OR s.id=:rootSid) and (m.rule is not null or m.rulesCategoryId is not null or m.rulePriority is not null)");
+ "(s.rootId=:rootSid OR s.id=:rootSid) and (m.ruleId is not null or m.rulesCategoryId is not null or m.rulePriority is not null)");
query.setParameter("rootSid", sid);
List<Integer> measureIds = query.getResultList();
PurgeUtils.deleteMeasuresById(getSession(), measureIds);