From: Sébastien Lesaint Date: Tue, 24 Nov 2015 13:16:57 +0000 (+0100) Subject: SONAR-7027 add MeasureDao#selectBySnapshotAndMetrics X-Git-Tag: 5.3-RC1~174 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=72a252ae0f8e6b6f9d54aade3188f4d6c9c2fcb7;p=sonarqube.git SONAR-7027 add MeasureDao#selectBySnapshotAndMetrics --- diff --git a/sonar-db/src/main/java/org/sonar/db/measure/MeasureDao.java b/sonar-db/src/main/java/org/sonar/db/measure/MeasureDao.java index 13b27d68768..23458f0b882 100644 --- a/sonar-db/src/main/java/org/sonar/db/measure/MeasureDao.java +++ b/sonar-db/src/main/java/org/sonar/db/measure/MeasureDao.java @@ -93,6 +93,19 @@ public class MeasureDao implements Dao { }); } + /** + * Used by plugin Developer Cockpit + */ + public List selectBySnapshotAndMetrics(final DbSession dbSession, final long snapshotId, Collection metricIds) { + return DatabaseUtils.executeLargeInputs(metricIds, new Function, List>() { + @Override + @Nonnull + public List apply(@Nonnull List input) { + return mapper(dbSession).selectBySnapshotAndMetrics(snapshotId, input); + } + }); + } + public void insert(DbSession session, MeasureDto measureDto) { mapper(session).insert(measureDto); } diff --git a/sonar-db/src/main/java/org/sonar/db/measure/MeasureMapper.java b/sonar-db/src/main/java/org/sonar/db/measure/MeasureMapper.java index fc6debc0a62..a5b096001f8 100644 --- a/sonar-db/src/main/java/org/sonar/db/measure/MeasureMapper.java +++ b/sonar-db/src/main/java/org/sonar/db/measure/MeasureMapper.java @@ -34,6 +34,8 @@ public interface MeasureMapper { List selectByDeveloperForSnapshotAndMetrics(@Param("developerId") long developerId, @Param("snapshotId") long snapshotId, @Param("metricIds") List metricIds); + List selectBySnapshotAndMetrics(@Param("snapshotId") long snapshotId, @Param("metricIds") List input); + @CheckForNull MeasureDto selectByComponentAndMetric(@Param("componentKey") String componentKey, @Param("metricKey") String metricKey); diff --git a/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml b/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml index 7874e1e2d20..f2d22396374 100644 --- a/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml +++ b/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml @@ -92,6 +92,22 @@ + +