summaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-06-22 12:10:47 +0200
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-06-24 11:41:07 +0200
commit04c9396965fa0c915c4e2c780b9576c99dfa7866 (patch)
tree93d5b883dd311a817bbdf41ef6294a36fe7a7df2 /sonar-core
parent81b9f4bb5f38d9cd514843f945534a0e24cb1032 (diff)
downloadsonarqube-04c9396965fa0c915c4e2c780b9576c99dfa7866.tar.gz
sonarqube-04c9396965fa0c915c4e2c780b9576c99dfa7866.zip
SONAR-6611 WS custom_measures/update update a custom measure
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/measure/custom/db/CustomMeasureMapper.java8
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/measure/custom/db/CustomMeasureMapper.xml10
2 files changed, 15 insertions, 3 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/measure/custom/db/CustomMeasureMapper.java b/sonar-core/src/main/java/org/sonar/core/measure/custom/db/CustomMeasureMapper.java
index bfc7eb929ea..444753996da 100644
--- a/sonar-core/src/main/java/org/sonar/core/measure/custom/db/CustomMeasureMapper.java
+++ b/sonar-core/src/main/java/org/sonar/core/measure/custom/db/CustomMeasureMapper.java
@@ -24,7 +24,11 @@ import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface CustomMeasureMapper {
- void insert(CustomMeasureDto customMeasureDto);
+ void insert(CustomMeasureDto customMeasure);
+
+ void update(CustomMeasureDto customMeasure);
+
+ void delete(long id);
void deleteByMetricIds(@Param("metricIds") List<Integer> metricIds);
@@ -34,7 +38,5 @@ public interface CustomMeasureMapper {
List<CustomMeasureDto> selectByComponentUuid(String s);
- void delete(long id);
-
int countByComponentIdAndMetricId(@Param("componentUuid") String componentUuid, @Param("metricId") int metricId);
}
diff --git a/sonar-core/src/main/resources/org/sonar/core/measure/custom/db/CustomMeasureMapper.xml b/sonar-core/src/main/resources/org/sonar/core/measure/custom/db/CustomMeasureMapper.xml
index 12a61bdf359..f9062d192d6 100644
--- a/sonar-core/src/main/resources/org/sonar/core/measure/custom/db/CustomMeasureMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/measure/custom/db/CustomMeasureMapper.xml
@@ -47,6 +47,16 @@
)
</insert>
+ <update id="update" parameterType="CustomMeasure">
+ update manual_measures
+ set value = #{value, jdbcType=DOUBLE},
+ text_value = #{textValue, jdbcType=VARCHAR},
+ description = #{description, jdbcType=VARCHAR},
+ user_login = #{userLogin, jdbcType=VARCHAR},
+ updated_at = #{updatedAt, jdbcType=BIGINT}
+ where id = #{id}
+ </update>
+
<delete id="deleteByMetricIds">
delete from manual_measures
where metric_id in