From: Teryk Bellahsene Date: Mon, 1 Jun 2015 10:49:29 +0000 (+0200) Subject: refactoring - MetricDto sanitization X-Git-Tag: 5.2-RC1~1751 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2b5a21f3b3e2c44acccbfaf9cf3a36607415a5a9;p=sonarqube.git refactoring - MetricDto sanitization --- 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 @@ 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},