Interface VcsPullRequestDao
-
- All Superinterfaces:
BambooObjectDao<MutableVcsPullRequest>
- All Known Implementing Classes:
VcsPullRequestHibernateDao
public interface VcsPullRequestDao extends BambooObjectDao<MutableVcsPullRequest>
- Since:
- 6.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @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.intremoveOrphanedPullRequests()Remove pull requests which are neither linked to any repository nor to any plan branch.-
Methods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectDao
countAll, countWithRestriction, delete, deleteAll, findAll, findById, merge, save, saveAll
-
-
-
-
Method Detail
-
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
@NotNull @NotNull List<MutableVcsPullRequest> findByRepository(long repositoryId, boolean isOpen)
Search pull requests by target repository and status.- Parameters:
repositoryId- target repository idisOpen- status- Returns:
- list of pull requests
-
findById
@Nullable @Nullable MutableVcsPullRequest findById(long id)
-
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
-
-