You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IssueMapper.java 3.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2024 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. package org.sonar.db.issue;
  21. import java.util.Collection;
  22. import java.util.List;
  23. import java.util.Set;
  24. import javax.annotation.Nullable;
  25. import org.apache.ibatis.annotations.Param;
  26. import org.apache.ibatis.cursor.Cursor;
  27. import org.apache.ibatis.session.ResultHandler;
  28. import org.sonar.db.Pagination;
  29. import org.sonar.db.component.ComponentDto;
  30. public interface IssueMapper {
  31. IssueDto selectByKey(String key);
  32. Set<String> selectComponentUuidsOfOpenIssuesForProjectUuid(String projectUuid);
  33. List<IssueDto> selectByKeys(List<String> keys);
  34. Set<String> selectIssueKeysByComponentUuid(@Param("componentUuid") String componentUuid);
  35. Set<String> selectIssueKeysByComponentUuidWithFilters(@Param("componentUuid") String componentUuid,
  36. @Param("includingRepositories") List<String> includingRepositories,
  37. @Param("excludingRepositories") List<String> excludingRepositories,
  38. @Param("languages") List<String> languages, @Param("pagination") Pagination pagination);
  39. Set<String> selectIssueKeysByComponentUuidAndChangedSinceDate(@Param("componentUuid") String componentUuid,
  40. @Param("changedSince") long changedSince,
  41. @Param("includingRepositories") List<String> includingRepositories,
  42. @Param("excludingRepositories") List<String> excludingRepositories,
  43. @Param("languages") List<String> languages, @Param("pagination") Pagination pagination);
  44. List<IssueDto> selectByKeysIfNotUpdatedAt(@Param("keys") List<String> keys, @Param("updatedAt") long updatedAt);
  45. List<PrIssueDto> selectOpenByComponentUuids(List<String> componentUuids);
  46. void insert(IssueDto issue);
  47. int update(IssueDto issue);
  48. void insertAsNewCodeOnReferenceBranch(NewCodeReferenceIssueDto issue);
  49. void insertIssueImpact(@Param("issueKey") String issueKey, @Param("dto") ImpactDto issue);
  50. void deleteAsNewCodeOnReferenceBranch(String issueKey);
  51. int updateIfBeforeSelectedDate(IssueDto issue);
  52. void scrollNonClosedByComponentUuid(@Param("componentUuid") String componentUuid, ResultHandler<IssueDto> handler);
  53. void scrollClosedByComponentUuid(@Param("componentUuid") String componentUuid, @Param("closeDateAfter") long closeDateAfter, ResultHandler<IssueDto> handler);
  54. Cursor<IndexedIssueDto> scrollIssuesForIndexation(@Nullable @Param("branchUuid") String branchUuid, @Nullable @Param("issueKeys") Collection<String> issueKeys);
  55. Collection<IssueGroupDto> selectIssueGroupsByComponent(@Param("component") ComponentDto component, @Param("leakPeriodBeginningDate") long leakPeriodBeginningDate);
  56. Collection<IssueImpactGroupDto> selectIssueImpactGroupsByComponent(@Param("component") ComponentDto component, @Param("leakPeriodBeginningDate") long leakPeriodBeginningDate);
  57. List<IssueDto> selectByBranch(@Param("keys") Set<String> keys, @Nullable @Param("changedSince") Long changedSince);
  58. List<String> selectRecentlyClosedIssues(@Param("queryParams") IssueQueryParams issueQueryParams);
  59. List<String> selectIssueKeysByQuery(@Param("query") IssueListQuery issueListQuery, @Param("pagination") Pagination pagination);
  60. void deleteIssueImpacts(String issueKey);
  61. }