diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2014-12-11 09:15:28 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2014-12-11 09:28:18 +0100 |
commit | 713061ca31d6fb75c39b111870ffcb151d98aabf (patch) | |
tree | 140b7f2b883475b271568abda6394e00698570f8 /sonar-core | |
parent | 7db87980dd438b63e7434e2d2959d8abe090075e (diff) | |
download | sonarqube-713061ca31d6fb75c39b111870ffcb151d98aabf.tar.gz sonarqube-713061ca31d6fb75c39b111870ffcb151d98aabf.zip |
SONAR-5910 persist report in database
Diffstat (limited to 'sonar-core')
3 files changed, 4 insertions, 13 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/computation/db/AnalysisReportDto.java b/sonar-core/src/main/java/org/sonar/core/computation/db/AnalysisReportDto.java index 52b563dcd7a..8d9a90397fd 100644 --- a/sonar-core/src/main/java/org/sonar/core/computation/db/AnalysisReportDto.java +++ b/sonar-core/src/main/java/org/sonar/core/computation/db/AnalysisReportDto.java @@ -25,6 +25,7 @@ import org.sonar.core.persistence.Dto; import javax.annotation.Nullable; +import java.io.InputStream; import java.util.Date; public class AnalysisReportDto extends Dto<String> { @@ -32,7 +33,7 @@ public class AnalysisReportDto extends Dto<String> { private Long id; private String projectKey; private Status status; - private String data; + private InputStream data; private Long snapshotId; private Date startedAt; private Date finishedAt; @@ -75,11 +76,11 @@ public class AnalysisReportDto extends Dto<String> { this.status = Status.SUCCESS; } - public String getData() { + public InputStream getData() { return data; } - public AnalysisReportDto setData(@Nullable String data) { + public AnalysisReportDto setData(@Nullable InputStream data) { this.data = data; return this; } diff --git a/sonar-core/src/main/java/org/sonar/core/computation/db/AnalysisReportMapper.java b/sonar-core/src/main/java/org/sonar/core/computation/db/AnalysisReportMapper.java index ca950e1c1a2..f9841b5a9e2 100644 --- a/sonar-core/src/main/java/org/sonar/core/computation/db/AnalysisReportMapper.java +++ b/sonar-core/src/main/java/org/sonar/core/computation/db/AnalysisReportMapper.java @@ -25,8 +25,6 @@ import java.util.Date; import java.util.List; public interface AnalysisReportMapper { - void insert(AnalysisReportDto report); - List<AnalysisReportDto> selectByProjectKey(String projectKey); List<AnalysisReportDto> selectNextAvailableReport(@Param("availableStatus") AnalysisReportDto.Status availableStatus, @Param("busyStatus") AnalysisReportDto.Status busyStatus); diff --git a/sonar-core/src/main/resources/org/sonar/core/computation/db/AnalysisReportMapper.xml b/sonar-core/src/main/resources/org/sonar/core/computation/db/AnalysisReportMapper.xml index 16613e4a946..2fd0bd74625 100644 --- a/sonar-core/src/main/resources/org/sonar/core/computation/db/AnalysisReportMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/computation/db/AnalysisReportMapper.xml @@ -14,14 +14,6 @@ ar.finished_at as finishedAt </sql> - <insert id="insert" parameterType="AnalysisReport" useGeneratedKeys="true"> - insert into analysis_reports - (project_key, snapshot_id, report_status, report_data, created_at, updated_at, started_at, - finished_at) - values (#{projectKey}, #{snapshotId}, #{status}, #{data}, #{createdAt}, #{updatedAt}, #{startedAt}, - #{finishedAt}) - </insert> - <update id="cleanWithUpdateAllToPendingStatus" parameterType="map"> update analysis_reports set report_status=#{status}, updated_at=#{updatedAt} |