aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-06-01 12:49:29 +0200
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-06-01 12:50:20 +0200
commit2b5a21f3b3e2c44acccbfaf9cf3a36607415a5a9 (patch)
tree1d847df5fea621856008ce25fa4a6905a8ac638d
parenteb31baeceeec4ec36a792fc4905a2981b3fd2925 (diff)
downloadsonarqube-2b5a21f3b3e2c44acccbfaf9cf3a36607415a5a9.tar.gz
sonarqube-2b5a21f3b3e2c44acccbfaf9cf3a36607415a5a9.zip
refactoring - MetricDto sanitization
-rw-r--r--sonar-core/src/main/java/org/sonar/core/metric/db/MetricDto.java6
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/metric/db/MetricMapper.xml4
2 files changed, 5 insertions, 5 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/metric/db/MetricDto.java b/sonar-core/src/main/java/org/sonar/core/metric/db/MetricDto.java
index d2131c9008b..a821c9bd114 100644
--- a/sonar-core/src/main/java/org/sonar/core/metric/db/MetricDto.java
+++ b/sonar-core/src/main/java/org/sonar/core/metric/db/MetricDto.java
@@ -27,7 +27,7 @@ public class MetricDto {
private Integer id;
- private String name;
+ private String key;
private String shortName;
@@ -67,11 +67,11 @@ public class MetricDto {
}
public String getKey() {
- return name;
+ return key;
}
public MetricDto setKey(String name) {
- this.name = name;
+ this.key = name;
return this;
}
diff --git a/sonar-core/src/main/resources/org/sonar/core/metric/db/MetricMapper.xml b/sonar-core/src/main/resources/org/sonar/core/metric/db/MetricMapper.xml
index 6b427f585ba..04d03f221b6 100644
--- a/sonar-core/src/main/resources/org/sonar/core/metric/db/MetricMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/metric/db/MetricMapper.xml
@@ -5,7 +5,7 @@
<sql id="metricColumns">
m.id,
- m.name,
+ m.name as key,
m.description,
m.direction,
m.domain,
@@ -63,7 +63,7 @@
name, description, direction, domain, short_name, qualitative, val_type, user_managed, enabled, origin, worst_value,
best_value, optimized_best_value, hidden, delete_historical_data)
VALUES (
- #{name, jdbcType=VARCHAR}, #{description, jdbcType=VARCHAR}, #{direction, jdbcType=INTEGER},
+ #{key, jdbcType=VARCHAR}, #{description, jdbcType=VARCHAR}, #{direction, jdbcType=INTEGER},
#{domain, jdbcType=VARCHAR}, #{shortName, jdbcType=VARCHAR}, #{qualitative, jdbcType=BOOLEAN},
#{valueType, jdbcType=VARCHAR}, #{userManaged, jdbcType=BOOLEAN}, #{enabled, jdbcType=BOOLEAN},
#{origin, jdbcType=VARCHAR}, #{worstValue, jdbcType=DOUBLE}, #{bestValue, jdbcType=DOUBLE},