Interface VcsPullRequestDao
- All Superinterfaces:
BambooObjectDao<MutableVcsPullRequest>
- All Known Implementing Classes:
VcsPullRequestHibernateDao
- Since:
- 6.0
-
Method Summary
Modifier and TypeMethodDescription@NotNull PartialList<MutableVcsPullRequest> closePullRequestsClosedInRepository(long targetRepositoryId, @NotNull Set<String> openPrKeys) Synchronize status of PRs in DB and in remote repository.Collection<? extends MutableVcsPullRequest> findAll()@Nullable MutableVcsPullRequestfindById(long id) @NotNull List<MutableVcsPullRequest> findByRepository(long repositoryId, boolean isOpen) Search pull requests by target repository and status.@Nullable MutableVcsPullRequestfindByRepositoryAndKey(long repositoryId, @NotNull String pullRequestKey) Search pull request by pull request key (unique on repository level) and target repository id@NotNull List<MutableVcsPullRequest> findByStatus(boolean isOpen, long startFromId, int limit) Search pull requests by status.intRemove pull requests which are neither linked to any repository nor to any plan branch.
-
Method Details
-
findAll
Collection<? extends MutableVcsPullRequest> findAll() -
findByRepositoryAndKey
@Nullable @Nullable MutableVcsPullRequest findByRepositoryAndKey(long repositoryId, @NotNull @NotNull String pullRequestKey) Search pull request by pull request key (unique on repository level) and target repository id- Parameters:
repositoryId- target repository idpullRequestKey- repository-specific pull request key- Returns:
- pull request or null if not found
-
findByRepository
Search pull requests by target repository and status.- Parameters:
repositoryId- target repository idisOpen- status- Returns:
- list of pull requests
-
findById
-
closePullRequestsClosedInRepository
@NotNull @NotNull PartialList<MutableVcsPullRequest> closePullRequestsClosedInRepository(long targetRepositoryId, @NotNull @NotNull Set<String> openPrKeys) Synchronize status of PRs in DB and in remote repository. Returns aPartialListof updated pull requests.If the returned list is incomplete, this method should be called again.
- Parameters:
targetRepositoryId- id of a remote repositoryopenPrKeys- keys of pull requests which have open state in remote repository- Returns:
- list of modified pull request entities
-
findByStatus
@NotNull @NotNull List<MutableVcsPullRequest> findByStatus(boolean isOpen, long startFromId, int limit) Search pull requests by status.- Parameters:
isOpen- statusstartFromId- entity id to start query fromlimit- maximum amount of values to be returned- Returns:
- list of pull requests sorted by id
-
removeOrphanedPullRequests
int removeOrphanedPullRequests()Remove pull requests which are neither linked to any repository nor to any plan branch.- Returns:
- number of removed records
-