]> source.dussan.org Git - sonarqube.git/commitdiff
Remove some useless views queries
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 15 Sep 2015 12:31:52 +0000 (14:31 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 15 Sep 2015 12:31:52 +0000 (14:31 +0200)
selectRootViews and selectViewTree are not used anymore in Views

sonar-db/src/main/java/org/sonar/db/MyBatis.java
sonar-db/src/main/java/org/sonar/db/component/ComponentDao.java
sonar-db/src/main/java/org/sonar/db/component/ComponentMapper.java
sonar-db/src/main/java/org/sonar/db/component/ViewsComponentDto.java [deleted file]
sonar-db/src/main/resources/org/sonar/db/component/ComponentMapper.xml

index e8345295856c6c18d21b374eb9e582e64ca0fed8..ea484ad78ef61c6dd0e4491e2916048d37a742ee 100644 (file)
@@ -45,7 +45,6 @@ import org.sonar.db.component.ResourceMapper;
 import org.sonar.db.component.SnapshotDto;
 import org.sonar.db.component.SnapshotMapper;
 import org.sonar.db.component.UuidWithProjectUuidDto;
-import org.sonar.db.component.ViewsComponentDto;
 import org.sonar.db.component.ViewsSnapshotDto;
 import org.sonar.db.compute.AnalysisReportDto;
 import org.sonar.db.compute.AnalysisReportMapper;
@@ -210,7 +209,6 @@ public class MyBatis {
     confBuilder.loadAlias("UuidWithProjectUuid", UuidWithProjectUuidDto.class);
     confBuilder.loadAlias("Event", EventDto.class);
     confBuilder.loadAlias("CustomMeasure", CustomMeasureDto.class);
-    confBuilder.loadAlias("ViewsComponent", ViewsComponentDto.class);
     confBuilder.loadAlias("ViewsSnapshot", ViewsSnapshotDto.class);
 
     // AuthorizationMapper has to be loaded before IssueMapper because this last one used it
index 2973460b1b3067ba4858ed8d0a66a84290e734dc..47c6575f4599f94d89bb6cb01e1fcaaac974e349 100644 (file)
@@ -271,14 +271,6 @@ public class ComponentDao implements Dao {
     mapper(session).update(item);
   }
 
-  public List<ViewsComponentDto> selectRootViews(DbSession dbSession) {
-    return mapper(dbSession).selectRootViews();
-  }
-
-  public List<ViewsComponentDto> selectViewTree(DbSession dbSession, String rootViewUuid) {
-    return mapper(dbSession).selectViewTree(rootViewUuid);
-  }
-
   private ComponentMapper mapper(DbSession session) {
     return session.getMapper(ComponentMapper.class);
   }
index 4204f8ad370a616a3d0f78118df0038256b88788..1fcdb3d1a7f72bb8302d86e761893383c998f05e 100644 (file)
@@ -124,7 +124,4 @@ public interface ComponentMapper {
 
   void update(ComponentDto componentDto);
 
-  List<ViewsComponentDto> selectRootViews();
-
-  List<ViewsComponentDto> selectViewTree(@Param("rootViewUuid") String rootViewUuid);
 }
diff --git a/sonar-db/src/main/java/org/sonar/db/component/ViewsComponentDto.java b/sonar-db/src/main/java/org/sonar/db/component/ViewsComponentDto.java
deleted file mode 100644 (file)
index 8aa0669..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * 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.db.component;
-
-public class ViewsComponentDto {
-  private Long id;
-  private String name;
-  private String uuid;
-  private String kee;
-  private String scope;
-  private String qualifier;
-  private Long copyResourceId;
-  private String moduleUuid;
-
-  public Long getId() {
-    return id;
-  }
-
-  public void setId(Long id) {
-    this.id = id;
-  }
-
-  public String getName() {
-    return name;
-  }
-
-  public void setName(String name) {
-    this.name = name;
-  }
-
-  public String getUuid() {
-    return uuid;
-  }
-
-  public void setUuid(String uuid) {
-    this.uuid = uuid;
-  }
-
-  public String getKee() {
-    return kee;
-  }
-
-  public void setKee(String kee) {
-    this.kee = kee;
-  }
-
-  public String getScope() {
-    return scope;
-  }
-
-  public void setScope(String scope) {
-    this.scope = scope;
-  }
-
-  public String getQualifier() {
-    return qualifier;
-  }
-
-  public void setQualifier(String qualifier) {
-    this.qualifier = qualifier;
-  }
-
-  public Long getCopyResourceId() {
-    return copyResourceId;
-  }
-
-  public void setCopyResourceId(Long copyResourceId) {
-    this.copyResourceId = copyResourceId;
-  }
-
-  public String getModuleUuid() {
-    return moduleUuid;
-  }
-
-  public void setModuleUuid(String moduleUuid) {
-    this.moduleUuid = moduleUuid;
-  }
-
-  @Override
-  public String toString() {
-    return "ViewsComponentDto{" +
-        "id=" + id +
-        ", name='" + name + '\'' +
-        ", uuid='" + uuid + '\'' +
-        ", kee='" + kee + '\'' +
-        ", scope='" + scope + '\'' +
-        ", qualifier='" + qualifier + '\'' +
-        ", copyResourceId='" + copyResourceId + '\'' +
-        ", moduleUuid='" + moduleUuid + '\'' +
-        '}';
-  }
-}
index a3c2a787c1356da5ea0d7dde1933eeabc75c6626..cc4c2d83500c2c06f9bcead1fda9ade27fd94e65 100644 (file)
     WHERE uuid=#{uuid}
   </insert>
 
-  <select id="selectRootViews" resultType="ViewsComponent">
-    SELECT
-    <include refid="viewsComponentColumns"/>
-    FROM projects p
-    <where>
-      p.scope = 'PRJ'
-      and p.qualifier = 'VW'
-    </where>
-  </select>
-
-  <select id="selectViewTree" resultType="ViewsComponent" parameterType="String">
-    select
-    <include refid="viewsComponentColumns"/>
-    from projects p
-    <where>
-      project_uuid = #{rootViewUuid}
-      and p.uuid != #{rootViewUuid}
-      and p.scope in ('PRJ', 'FIL')
-      and p.qualifier in ('VW', 'SVW', 'TRK')
-      and p.enabled = ${_true}
-    </where>
-    order by module_uuid_path;
-  </select>
-
 </mapper>