From 1011251f1dd0d19f9545b65425205f55cb74d6d8 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Vilain Date: Fri, 26 Apr 2013 15:18:26 +0200 Subject: [PATCH] SONAR-3893 Renamed column in SNAPSHOT_DATA from value to snapshot_data --- .../org/sonar/batch/index/ComponentDataPersister.java | 2 +- .../should_persist_component_data-result.xml | 4 ++-- .../org/sonar/core/source/HtmlSourceDecorator.java | 6 +++--- .../org/sonar/core/source/jdbc/SnapshotDataDto.java | 10 +++++----- .../resources/org/sonar/core/persistence/schema-h2.ddl | 2 +- .../org/sonar/core/source/jdbc/SnapshotDataMapper.xml | 10 +++++----- .../sonar/core/source/jdbc/SnapshotDataDaoTest.java | 6 +++--- .../PurgeCommandsTest/shouldDeleteSnapshot-result.xml | 2 +- .../purge/PurgeCommandsTest/shouldDeleteSnapshot.xml | 4 ++-- .../PurgeCommandsTest/shouldPurgeSnapshot-result.xml | 2 +- .../purge/PurgeCommandsTest/shouldPurgeSnapshot.xml | 4 ++-- .../core/source/HtmlSourceDecoratorTest/shared.xml | 8 ++++---- .../core/source/jdbc/SnapshotDataDaoTest/shared.xml | 4 ++-- .../WEB-INF/db/migrate/387_create_snapshot_data.rb | 2 +- 14 files changed, 33 insertions(+), 33 deletions(-) diff --git a/sonar-batch/src/main/java/org/sonar/batch/index/ComponentDataPersister.java b/sonar-batch/src/main/java/org/sonar/batch/index/ComponentDataPersister.java index 5a875e32312..d0ef14aebeb 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/index/ComponentDataPersister.java +++ b/sonar-batch/src/main/java/org/sonar/batch/index/ComponentDataPersister.java @@ -47,7 +47,7 @@ public class ComponentDataPersister implements ScanPersister { dto.setSnapshotId(snapshot.getId()); dto.setResourceId(snapshot.getResourceId()); dto.setDataType(dataEntry.key()); - dto.setValue(dataEntry.value().writeString()); + dto.setData(dataEntry.value().writeString()); // TODO bulk insert dao.insert(dto); diff --git a/sonar-batch/src/test/resources/org/sonar/batch/index/ComponentDataPersisterTest/should_persist_component_data-result.xml b/sonar-batch/src/test/resources/org/sonar/batch/index/ComponentDataPersisterTest/should_persist_component_data-result.xml index 559c33319a2..647650b1da0 100644 --- a/sonar-batch/src/test/resources/org/sonar/batch/index/ComponentDataPersisterTest/should_persist_component_data-result.xml +++ b/sonar-batch/src/test/resources/org/sonar/batch/index/ComponentDataPersisterTest/should_persist_component_data-result.xml @@ -1,5 +1,5 @@ - - + + \ No newline at end of file diff --git a/sonar-core/src/main/java/org/sonar/core/source/HtmlSourceDecorator.java b/sonar-core/src/main/java/org/sonar/core/source/HtmlSourceDecorator.java index 085f8eb4990..91936ce34ee 100644 --- a/sonar-core/src/main/java/org/sonar/core/source/HtmlSourceDecorator.java +++ b/sonar-core/src/main/java/org/sonar/core/source/HtmlSourceDecorator.java @@ -73,11 +73,11 @@ public class HtmlSourceDecorator implements ServerComponent { } private void loadSnapshotData(DecorationDataHolder decorationDataHolder, SnapshotDataDto snapshotDataEntry) { - if(!Strings.isNullOrEmpty(snapshotDataEntry.getValue())) { + if(!Strings.isNullOrEmpty(snapshotDataEntry.getData())) { if (SnapshotDataType.isSyntaxHighlighting(snapshotDataEntry.getDataType())) { - decorationDataHolder.loadSyntaxHighlightingData(snapshotDataEntry.getValue()); + decorationDataHolder.loadSyntaxHighlightingData(snapshotDataEntry.getData()); } else if (SnapshotDataType.isSymbolHighlighting(snapshotDataEntry.getDataType())) { - decorationDataHolder.loadSymbolReferences(snapshotDataEntry.getValue()); + decorationDataHolder.loadSymbolReferences(snapshotDataEntry.getData()); } } } diff --git a/sonar-core/src/main/java/org/sonar/core/source/jdbc/SnapshotDataDto.java b/sonar-core/src/main/java/org/sonar/core/source/jdbc/SnapshotDataDto.java index e42c122bd94..5d70fda1689 100644 --- a/sonar-core/src/main/java/org/sonar/core/source/jdbc/SnapshotDataDto.java +++ b/sonar-core/src/main/java/org/sonar/core/source/jdbc/SnapshotDataDto.java @@ -28,7 +28,7 @@ public class SnapshotDataDto { private long id; private long snapshotId; private long resourceId; - private String value; + private String data; private String dataType; public long getSnapshotId() { @@ -39,8 +39,8 @@ public class SnapshotDataDto { return resourceId; } - public String getValue() { - return value; + public String getData() { + return data; } public String getDataType() { @@ -63,8 +63,8 @@ public class SnapshotDataDto { this.resourceId = resourceId; } - public void setValue(String value) { - this.value = value; + public void setData(String data) { + this.data = data; } public void setDataType(String dataType) { diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl index 598a8a1f50b..837dbbdcf42 100644 --- a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl +++ b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl @@ -554,7 +554,7 @@ CREATE TABLE "SNAPSHOT_DATA" ( "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), "SNAPSHOT_ID" INTEGER, "RESOURCE_ID" INTEGER, - "VALUE" VARCHAR(16777215), + "SNAPSHOT_DATA" VARCHAR(16777215), "DATA_TYPE" VARCHAR(50), "CREATED_AT" TIMESTAMP, "UPDATED_AT" TIMESTAMP, diff --git a/sonar-core/src/main/resources/org/sonar/core/source/jdbc/SnapshotDataMapper.xml b/sonar-core/src/main/resources/org/sonar/core/source/jdbc/SnapshotDataMapper.xml index ca10588f169..6d92b6fb878 100644 --- a/sonar-core/src/main/resources/org/sonar/core/source/jdbc/SnapshotDataMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/source/jdbc/SnapshotDataMapper.xml @@ -6,7 +6,7 @@