aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-db-dao/src/main')
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java4
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java9
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java6
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDto.java15
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/component/ResourceDao.java38
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/component/ResourceDto.java10
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/component/ResourceMapper.java28
-rw-r--r--server/sonar-db-dao/src/main/resources/org/sonar/db/component/ComponentMapper.xml3
-rw-r--r--server/sonar-db-dao/src/main/resources/org/sonar/db/component/ResourceMapper.xml12
9 files changed, 3 insertions, 122 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java b/server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java
index 9ee4a9586cf..a6f33ee50a6 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java
@@ -29,13 +29,12 @@ import org.sonar.db.ce.CeTaskInputDao;
import org.sonar.db.component.ComponentDao;
import org.sonar.db.component.ComponentKeyUpdaterDao;
import org.sonar.db.component.ComponentLinkDao;
-import org.sonar.db.component.ResourceDao;
import org.sonar.db.component.SnapshotDao;
import org.sonar.db.duplication.DuplicationDao;
+import org.sonar.db.es.EsQueueDao;
import org.sonar.db.event.EventDao;
import org.sonar.db.issue.IssueChangeDao;
import org.sonar.db.issue.IssueDao;
-import org.sonar.db.es.EsQueueDao;
import org.sonar.db.loadedtemplate.LoadedTemplateDao;
import org.sonar.db.measure.MeasureDao;
import org.sonar.db.measure.custom.CustomMeasureDao;
@@ -111,7 +110,6 @@ public class DaoModule extends Module {
QualityGateConditionDao.class,
QualityGateDao.class,
QualityProfileDao.class,
- ResourceDao.class,
RoleDao.class,
RuleDao.class,
RuleRepositoryDao.class,
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java b/server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java
index bd0fd55735e..2948b8469f8 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java
@@ -28,13 +28,12 @@ import org.sonar.db.ce.CeTaskInputDao;
import org.sonar.db.component.ComponentDao;
import org.sonar.db.component.ComponentKeyUpdaterDao;
import org.sonar.db.component.ComponentLinkDao;
-import org.sonar.db.component.ResourceDao;
import org.sonar.db.component.SnapshotDao;
import org.sonar.db.duplication.DuplicationDao;
+import org.sonar.db.es.EsQueueDao;
import org.sonar.db.event.EventDao;
import org.sonar.db.issue.IssueChangeDao;
import org.sonar.db.issue.IssueDao;
-import org.sonar.db.es.EsQueueDao;
import org.sonar.db.loadedtemplate.LoadedTemplateDao;
import org.sonar.db.measure.MeasureDao;
import org.sonar.db.measure.custom.CustomMeasureDao;
@@ -84,7 +83,6 @@ public class DbClient {
private final InternalPropertiesDao internalPropertiesDao;
private final SnapshotDao snapshotDao;
private final ComponentDao componentDao;
- private final ResourceDao resourceDao;
private final ComponentKeyUpdaterDao componentKeyUpdaterDao;
private final MeasureDao measureDao;
private final UserDao userDao;
@@ -141,7 +139,6 @@ public class DbClient {
internalPropertiesDao = getDao(map, InternalPropertiesDao.class);
snapshotDao = getDao(map, SnapshotDao.class);
componentDao = getDao(map, ComponentDao.class);
- resourceDao = getDao(map, ResourceDao.class);
componentKeyUpdaterDao = getDao(map, ComponentKeyUpdaterDao.class);
measureDao = getDao(map, MeasureDao.class);
userDao = getDao(map, UserDao.class);
@@ -236,10 +233,6 @@ public class DbClient {
return componentDao;
}
- public ResourceDao resourceDao() {
- return resourceDao;
- }
-
public ComponentKeyUpdaterDao componentKeyUpdaterDao() {
return componentKeyUpdaterDao;
}
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java b/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java
index ea1251d69fe..3e879c9e948 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java
@@ -41,7 +41,6 @@ import org.sonar.db.component.ComponentLinkMapper;
import org.sonar.db.component.ComponentMapper;
import org.sonar.db.component.FilePathWithHashDto;
import org.sonar.db.component.ResourceDto;
-import org.sonar.db.component.ResourceMapper;
import org.sonar.db.component.SnapshotDto;
import org.sonar.db.component.SnapshotMapper;
import org.sonar.db.component.UuidWithProjectUuidDto;
@@ -49,13 +48,13 @@ import org.sonar.db.component.ViewsSnapshotDto;
import org.sonar.db.debt.RequirementMigrationDto;
import org.sonar.db.duplication.DuplicationMapper;
import org.sonar.db.duplication.DuplicationUnitDto;
+import org.sonar.db.es.EsQueueMapper;
import org.sonar.db.event.EventDto;
import org.sonar.db.event.EventMapper;
import org.sonar.db.issue.IssueChangeDto;
import org.sonar.db.issue.IssueChangeMapper;
import org.sonar.db.issue.IssueDto;
import org.sonar.db.issue.IssueMapper;
-import org.sonar.db.es.EsQueueMapper;
import org.sonar.db.loadedtemplate.LoadedTemplateDto;
import org.sonar.db.loadedtemplate.LoadedTemplateMapper;
import org.sonar.db.measure.MeasureDto;
@@ -181,9 +180,6 @@ public class MyBatis implements Startable {
confBuilder.loadAlias("UuidWithProjectUuid", UuidWithProjectUuidDto.class);
confBuilder.loadAlias("ViewsSnapshot", ViewsSnapshotDto.class);
- // ResourceMapper has to be loaded before IssueMapper because this last one used it
- confBuilder.loadMapper(ResourceMapper.class);
-
// keep them sorted alphabetically
Class<?>[] mappers = {
ActiveRuleMapper.class,
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDto.java
index 215a248c0c4..87385285a86 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDto.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDto.java
@@ -124,7 +124,6 @@ public class ComponentDto implements Component {
private boolean isPrivate = false;
private Date createdAt;
- private Long authorizationUpdatedAt;
public static String formatUuidPathFromParent(ComponentDto parent) {
checkArgument(!Strings.isNullOrEmpty(parent.getUuidPath()));
@@ -348,19 +347,6 @@ public class ComponentDto implements Component {
return this;
}
- /**
- * Only available on projects
- */
- @CheckForNull
- public Long getAuthorizationUpdatedAt() {
- return authorizationUpdatedAt;
- }
-
- public ComponentDto setAuthorizationUpdatedAt(@Nullable Long authorizationUpdatedAt) {
- this.authorizationUpdatedAt = authorizationUpdatedAt;
- return this;
- }
-
public String getKey() {
return key();
}
@@ -444,7 +430,6 @@ public class ComponentDto implements Component {
.append("longName", longName)
.append("language", language)
.append("enabled", enabled)
- .append("authorizationUpdatedAt", authorizationUpdatedAt)
.append("private", isPrivate)
.toString();
}
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ResourceDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ResourceDao.java
deleted file mode 100644
index 9c481d66682..00000000000
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ResourceDao.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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;
-
-import org.sonar.api.utils.System2;
-import org.sonar.db.Dao;
-import org.sonar.db.DbSession;
-
-public class ResourceDao implements Dao {
-
- private final System2 system2;
-
- public ResourceDao(System2 system2) {
- this.system2 = system2;
- }
-
- public void updateAuthorizationDate(Long projectId, DbSession session) {
- session.getMapper(ResourceMapper.class).updateAuthorizationDate(projectId, system2.now());
- }
-
-}
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ResourceDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ResourceDto.java
index 0fc5e2415b8..b8cc1cf53f6 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ResourceDto.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ResourceDto.java
@@ -47,7 +47,6 @@ public class ResourceDto {
private String copyComponentUuid;
private String developerUuid;
private Date createdAt;
- private Long authorizationUpdatedAt;
public Long getId() {
return id;
@@ -221,13 +220,4 @@ public class ResourceDto {
this.createdAt = date;
return this;
}
-
- public Long getAuthorizationUpdatedAt() {
- return authorizationUpdatedAt;
- }
-
- public ResourceDto setAuthorizationUpdatedAt(Long authorizationUpdatedAt) {
- this.authorizationUpdatedAt = authorizationUpdatedAt;
- return this;
- }
}
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ResourceMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ResourceMapper.java
deleted file mode 100644
index 06bc63393c9..00000000000
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ResourceMapper.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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;
-
-import org.apache.ibatis.annotations.Param;
-
-public interface ResourceMapper {
-
- void updateAuthorizationDate(@Param("projectId") Long projectId, @Param("authorizationDate") Long authorizationDate);
-
-}
diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/component/ComponentMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/component/ComponentMapper.xml
index fecf8cf8715..43450db333a 100644
--- a/server/sonar-db-dao/src/main/resources/org/sonar/db/component/ComponentMapper.xml
+++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/component/ComponentMapper.xml
@@ -25,7 +25,6 @@
p.copy_component_uuid as copyComponentUuid,
p.developer_uuid as developerUuid,
p.private as isPrivate,
- p.authorization_updated_at as authorizationUpdatedAt,
p.created_at as createdAt
</sql>
@@ -473,7 +472,6 @@
developer_uuid,
enabled,
created_at,
- authorization_updated_at,
b_changed,
b_copy_component_uuid,
b_description,
@@ -509,7 +507,6 @@
#{developerUuid,jdbcType=VARCHAR},
#{enabled,jdbcType=BOOLEAN},
#{createdAt,jdbcType=TIMESTAMP},
- #{authorizationUpdatedAt,jdbcType=BIGINT},
${_false},
null,
null,
diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/component/ResourceMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/component/ResourceMapper.xml
deleted file mode 100644
index 2ef477b7975..00000000000
--- a/server/sonar-db-dao/src/main/resources/org/sonar/db/component/ResourceMapper.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd">
-
-<mapper namespace="org.sonar.db.component.ResourceMapper">
-
- <update id="updateAuthorizationDate" parameterType="map">
- update projects set authorization_updated_at=#{authorizationDate}
- where id=#{projectId,jdbcType=BIGINT}
- </update>
-
-</mapper>
-