From 255d1fb82f78f046ef95f2e7a45cc5d4ba94c97e Mon Sep 17 00:00:00 2001 From: Michal Duda Date: Mon, 21 Dec 2020 15:21:40 +0100 Subject: [PATCH] SONAR-13999 Remove organizations from Portfolio WS --- .../java/org/sonar/db/project/ProjectDao.java | 10 +--- .../org/sonar/db/project/ProjectMapper.java | 4 +- .../org/sonar/db/project/ProjectMapper.xml | 13 +---- .../org/sonar/db/project/ProjectDaoTest.java | 22 +++---- .../org/sonar/db/purge/PurgeCommandsTest.java | 57 +++++++------------ .../sonar/db/component/ComponentDbTester.java | 27 +++++---- .../sonar/db/component/ComponentTesting.java | 19 ------- 7 files changed, 53 insertions(+), 99 deletions(-) diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectDao.java index 8d2509cf449..62842a31283 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectDao.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectDao.java @@ -50,7 +50,7 @@ public class ProjectDao implements Dao { return Optional.ofNullable(mapper(session).selectProjectOrAppByKey(key)); } - public List selectAllApplications(DbSession session){ + public List selectAllApplications(DbSession session) { return mapper(session).selectAllApplications(); } @@ -76,12 +76,8 @@ public class ProjectDao implements Dao { return Optional.ofNullable(mapper(session).selectByUuid(uuid)); } - public List selectByOrganizationUuid(DbSession session, String organizationUuid) { - return mapper(session).selectByOrganizationUuid(organizationUuid); - } - - public List selectProjectsByOrganizationUuid(DbSession session, String organizationUuid) { - return mapper(session).selectProjectsByOrganizationUuid(organizationUuid); + public List selectAll(DbSession session) { + return mapper(session).selectAll(); } public List selectByUuids(DbSession session, Set uuids) { diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectMapper.java index c2fafe6a8f3..9e67ccebb2b 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectMapper.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectMapper.java @@ -44,7 +44,7 @@ public interface ProjectMapper { List selectByUuids(@Param("uuids") Collection uuids); - List selectByOrganizationUuid(@Param("organizationUuid") String organizationUuid); + List selectAll(); void updateKey(@Param("uuid") String uuid, @Param("newKey") String newKey, @Param("updatedAt") long updatedAt); @@ -54,8 +54,6 @@ public interface ProjectMapper { List selectProjects(); - List selectProjectsByOrganizationUuid(String organizationUuid); - void updateVisibility(@Param("uuid") String uuid, @Param("isPrivate") boolean isPrivate, @Param("updatedAt") long updatedAt); List selectAllApplications(); diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/project/ProjectMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/project/ProjectMapper.xml index dfc9c9d51fc..99a1bcfc86b 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/project/ProjectMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/project/ProjectMapper.xml @@ -66,21 +66,10 @@ p.qualifier='TRK' - select from projects p - where - p.organization_uuid=#{organizationUuid,jdbcType=VARCHAR} - - -