summaryrefslogtreecommitdiffstats
path: root/sonar-batch/src
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-09-17 16:45:06 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2012-09-17 16:45:06 +0200
commitc33db9cecb2f127084b0cf48af68daa9c1ba4e78 (patch)
treebc5e8ca809663f6d7085065c0923b0cc330659da /sonar-batch/src
parent50d9a253d8cfeff495513ec04512462d4fa214d3 (diff)
downloadsonarqube-c33db9cecb2f127084b0cf48af68daa9c1ba4e78.tar.gz
sonarqube-c33db9cecb2f127084b0cf48af68daa9c1ba4e78.zip
Revert "SONAR-3778 Bad performances when Hibernate requests measures on quality models"
This reverts commit 5000405959b05fb3562a2f2cd55a1ba10e6464e2.
Diffstat (limited to 'sonar-batch/src')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/DefaultTimeMachine.java4
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java4
2 files changed, 4 insertions, 4 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/DefaultTimeMachine.java b/sonar-batch/src/main/java/org/sonar/batch/DefaultTimeMachine.java
index 8d34661cb25..ad2ec8007b8 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/DefaultTimeMachine.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/DefaultTimeMachine.java
@@ -99,7 +99,7 @@ public class DefaultTimeMachine implements TimeMachine {
params.put("status", Snapshot.STATUS_PROCESSED);
params.put("lib", Qualifiers.LIBRARY);
- sb.append(" AND m.characteristicId IS NULL");
+ sb.append(" AND m.characteristic IS NULL");
sb.append(" AND m.personId IS NULL");
sb.append(" AND m.ruleId IS NULL AND m.rulePriority IS NULL");
if (!metricIds.isEmpty()) {
@@ -161,6 +161,8 @@ public class DefaultTimeMachine implements TimeMachine {
measure.setVariation4(model.getVariationValue4());
measure.setVariation5(model.getVariationValue5());
measure.setUrl(model.getUrl());
+ measure.setCharacteristic(model.getCharacteristic());
+ measure.setPersonId(model.getPersonId());
return measure;
}
}
diff --git a/sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java b/sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java
index 36b1e3837fb..ec036f13da4 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java
@@ -137,9 +137,7 @@ public final class MeasurePersister {
model.setVariationValue4(measure.getVariation4());
model.setVariationValue5(measure.getVariation5());
model.setUrl(measure.getUrl());
- if (measure.getCharacteristic()!=null) {
- model.setCharacteristicId(measure.getCharacteristic().getId());
- }
+ model.setCharacteristic(measure.getCharacteristic());
model.setPersonId(measure.getPersonId());
if (measure.getValue() != null) {
model.setValue(measure.getValue().doubleValue());