]> source.dussan.org Git - sonarqube.git/commitdiff
refactoring - MetricDto sanitization
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Mon, 1 Jun 2015 10:49:29 +0000 (12:49 +0200)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Mon, 1 Jun 2015 10:50:20 +0000 (12:50 +0200)
sonar-core/src/main/java/org/sonar/core/metric/db/MetricDto.java
sonar-core/src/main/resources/org/sonar/core/metric/db/MetricMapper.xml

index d2131c9008b7f5cc03fa119e4bf2adb530e146a1..a821c9bd114cfea6247bfd6475c7a6407834e653 100644 (file)
@@ -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;
   }
 
index 6b427f585ba47a47aa67bc5fb0c9416370eefeee..04d03f221b6906571a35d3a3045430b594183028 100644 (file)
@@ -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},