diff options
author | Léo Geoffroy <leo.geoffroy@sonarsource.com> | 2023-12-18 11:25:08 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-01-17 20:02:43 +0000 |
commit | d6fd3827d2e54ab066b15c2da0834f7a3c42d58e (patch) | |
tree | b4d38447b504384eeacfd8a398758dd4e27114b2 /server/sonar-db-dao/src/main/java/org/sonar/db/issue | |
parent | 55a7cc58fdded3a0670a2409c0a2b44e018a8381 (diff) | |
download | sonarqube-d6fd3827d2e54ab066b15c2da0834f7a3c42d58e.tar.gz sonarqube-d6fd3827d2e54ab066b15c2da0834f7a3c42d58e.zip |
SONAR-21259 Add Dao methods for issues_fixed table
Diffstat (limited to 'server/sonar-db-dao/src/main/java/org/sonar/db/issue')
3 files changed, 91 insertions, 0 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueFixedDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueFixedDao.java new file mode 100644 index 00000000000..e0cd66256a7 --- /dev/null +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueFixedDao.java @@ -0,0 +1,40 @@ +/* + * SonarQube + * Copyright (C) 2009-2023 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.issue; + +import java.util.List; +import org.apache.ibatis.annotations.Param; +import org.sonar.db.Dao; +import org.sonar.db.DbSession; + +public class IssueFixedDao implements Dao { + + public void insert(DbSession dbSession, IssueFixedDto fixedIssue) { + mapper(dbSession).insert(fixedIssue); + } + + private static IssueFixedMapper mapper(DbSession session) { + return session.getMapper(IssueFixedMapper.class); + } + + public List<IssueFixedDto> selectByPullRequest(DbSession dbSession, @Param("pullRequestUuid") String pullRequestUuid) { + return mapper(dbSession).selectByPullRequest(pullRequestUuid); + } +} diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueFixedDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueFixedDto.java new file mode 100644 index 00000000000..aeb19978f8e --- /dev/null +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueFixedDto.java @@ -0,0 +1,23 @@ +/* + * SonarQube + * Copyright (C) 2009-2023 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.issue; + +public record IssueFixedDto(String pullRequestUuid, String issueKey) { +} diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueFixedMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueFixedMapper.java new file mode 100644 index 00000000000..1970440b39a --- /dev/null +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueFixedMapper.java @@ -0,0 +1,28 @@ +/* + * SonarQube + * Copyright (C) 2009-2023 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.issue; + +import java.util.List; + +public interface IssueFixedMapper { + void insert(IssueFixedDto dto); + + List<IssueFixedDto> selectByPullRequest(String pullRequestUuid); +} |