aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core/src/main
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2015-01-28 12:24:33 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2015-01-29 15:08:49 +0100
commit18ff30bdf1a602b1eff8344af998ece8002af29e (patch)
tree90a78fdf40c002842cf0f4ef3bd79dadd3950865 /sonar-core/src/main
parent410a553075d6047fa3ec8721f84ad753e2545c5f (diff)
downloadsonarqube-18ff30bdf1a602b1eff8344af998ece8002af29e.tar.gz
sonarqube-18ff30bdf1a602b1eff8344af998ece8002af29e.zip
SONAR-6087 Purge removed Views and Sub-Views Index on each Views analysis
Diffstat (limited to 'sonar-core/src/main')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/component/UuidWithProjectUuidDto.java45
-rw-r--r--sonar-core/src/main/java/org/sonar/core/component/db/ComponentMapper.java4
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java2
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/component/db/ComponentMapper.xml2
4 files changed, 50 insertions, 3 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/component/UuidWithProjectUuidDto.java b/sonar-core/src/main/java/org/sonar/core/component/UuidWithProjectUuidDto.java
new file mode 100644
index 00000000000..82fe44a82dd
--- /dev/null
+++ b/sonar-core/src/main/java/org/sonar/core/component/UuidWithProjectUuidDto.java
@@ -0,0 +1,45 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2014 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * SonarQube is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.sonar.core.component;
+
+public class UuidWithProjectUuidDto {
+
+ private String uuid;
+ private String projectUuid;
+
+ public String getProjectUuid() {
+ return projectUuid;
+ }
+
+ public UuidWithProjectUuidDto setProjectUuid(String projectUuid) {
+ this.projectUuid = projectUuid;
+ return this;
+ }
+
+ public String getUuid() {
+ return uuid;
+ }
+
+ public UuidWithProjectUuidDto setUuid(String uuid) {
+ this.uuid = uuid;
+ return this;
+ }
+}
diff --git a/sonar-core/src/main/java/org/sonar/core/component/db/ComponentMapper.java b/sonar-core/src/main/java/org/sonar/core/component/db/ComponentMapper.java
index 81215f8d557..344bedd75fa 100644
--- a/sonar-core/src/main/java/org/sonar/core/component/db/ComponentMapper.java
+++ b/sonar-core/src/main/java/org/sonar/core/component/db/ComponentMapper.java
@@ -23,12 +23,12 @@ package org.sonar.core.component.db;
import org.apache.ibatis.annotations.Param;
import org.sonar.core.component.ComponentDto;
import org.sonar.core.component.FilePathWithHashDto;
+import org.sonar.core.component.UuidWithProjectUuidDto;
import javax.annotation.CheckForNull;
import java.util.Collection;
import java.util.List;
-import java.util.Map;
/**
* @since 4.3
@@ -88,7 +88,7 @@ public interface ComponentMapper {
/**
* Return all views and sub views
*/
- List<Map<String, String>> selectAllViewsAndSubViews(@Param("viewQualifier") String viewQualifier, @Param("subViewQualifier") String subViewQualifier);
+ List<UuidWithProjectUuidDto> selectAllViewsAndSubViews(@Param("viewQualifier") String viewQualifier, @Param("subViewQualifier") String subViewQualifier);
/**
* Return technical projects from a view or a sub-view
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java b/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java
index 75f75cf9089..a3c29f4e0c0 100644
--- a/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java
+++ b/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java
@@ -38,6 +38,7 @@ import org.sonar.core.cluster.WorkQueue;
import org.sonar.core.component.ComponentDto;
import org.sonar.core.component.FilePathWithHashDto;
import org.sonar.core.component.SnapshotDto;
+import org.sonar.core.component.UuidWithProjectUuidDto;
import org.sonar.core.component.db.ComponentMapper;
import org.sonar.core.component.db.SnapshotMapper;
import org.sonar.core.computation.db.AnalysisReportDto;
@@ -181,6 +182,7 @@ public class MyBatis implements BatchComponent, ServerComponent {
loadAlias(conf, "AnalysisReport", AnalysisReportDto.class);
loadAlias(conf, "IdUuidPair", IdUuidPair.class);
loadAlias(conf, "FilePathWithHash", FilePathWithHashDto.class);
+ loadAlias(conf, "UuidWithProjectUuid", UuidWithProjectUuidDto.class);
// AuthorizationMapper has to be loaded before IssueMapper because this last one used it
loadMapper(conf, "org.sonar.core.user.AuthorizationMapper");
diff --git a/sonar-core/src/main/resources/org/sonar/core/component/db/ComponentMapper.xml b/sonar-core/src/main/resources/org/sonar/core/component/db/ComponentMapper.xml
index c9a2d7ca514..3b496246050 100644
--- a/sonar-core/src/main/resources/org/sonar/core/component/db/ComponentMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/component/db/ComponentMapper.xml
@@ -156,7 +156,7 @@
</where>
</select>
- <select id="selectAllViewsAndSubViews" resultType="hashmap">
+ <select id="selectAllViewsAndSubViews" resultType="UuidWithProjectUuid">
SELECT v.uuid as "uuid", v.project_uuid as "projectUuid" FROM projects v
<where>
v.enabled=${_true} AND v.qualifier=#{viewQualifier} OR v.qualifier=#{subViewQualifier}