diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-06-01 12:26:34 +0200 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-06-01 12:29:01 +0200 |
commit | b99b802f6857f6384653e84988b77fb88e58f2ef (patch) | |
tree | df58d726a2b1608b12f967fddacf22a9fdb6ae8e /sonar-core | |
parent | ccb1bc6ac4dc9cfcb08ed1bb6625b1c2d3e4eebc (diff) | |
download | sonarqube-b99b802f6857f6384653e84988b77fb88e58f2ef.tar.gz sonarqube-b99b802f6857f6384653e84988b77fb88e58f2ef.zip |
SONAR-6570 ws api/metrics/search change endpoint to search
- change endpoint from 'list' to 'search'
- add pagination in response
- display only optional fields in WS description
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/metric/db/MetricMapper.java | 2 | ||||
-rw-r--r-- | sonar-core/src/main/resources/org/sonar/core/metric/db/MetricMapper.xml | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/metric/db/MetricMapper.java b/sonar-core/src/main/java/org/sonar/core/metric/db/MetricMapper.java index 46eaf787e21..dc85301383a 100644 --- a/sonar-core/src/main/java/org/sonar/core/metric/db/MetricMapper.java +++ b/sonar-core/src/main/java/org/sonar/core/metric/db/MetricMapper.java @@ -40,4 +40,6 @@ public interface MetricMapper { List<MetricDto> selectByKeys(@Param("keys") List<String> keys); void disable(@Param("ids") List<Integer> ids); + + int countCustom(); } 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 2e638309850..6b427f585ba 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 @@ -48,6 +48,14 @@ </where> ORDER BY UPPER(m.short_name) </select> + <select id="countCustom" resultType="Integer"> + SELECT COUNT(*) + FROM metrics m + <where> + AND m.enabled=${_true} + AND m.user_managed=${_true} + </where> + </select> <insert id="insert" parameterType="org.sonar.core.metric.db.MetricDto" useGeneratedKeys="true" keyColumn="id" keyProperty="id"> |