public class VcsPullRequestHibernateDao extends BambooHibernateObjectDao<MutableVcsPullRequest> implements VcsPullRequestDao
Constructor and Description |
---|
VcsPullRequestHibernateDao() |
Modifier and Type | Method and 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 MutableVcsPullRequest |
findById(long id) |
@NotNull List<MutableVcsPullRequest> |
findByRepository(long repositoryId,
boolean isOpen)
Search pull requests by target repository and status.
|
@Nullable MutableVcsPullRequest |
findByRepositoryAndKey(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 startId,
int maxLimit)
Search pull requests by status.
|
int |
removeOrphanedPullRequests()
Remove pull requests which are neither linked to any repository nor to any plan branch.
|
countAll, countWithRestriction, delete, deleteAll, executeCountQuery, findAll, findById, merge, save, saveAll
getCacheAwareHibernateTemplate
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
countAll, countWithRestriction, delete, deleteAll, findAll, findById, merge, save, saveAll
public Collection<? extends MutableVcsPullRequest> findAll()
findAll
in interface VcsPullRequestDao
@Nullable public @Nullable MutableVcsPullRequest findByRepositoryAndKey(long repositoryId, @NotNull @NotNull String pullRequestKey)
VcsPullRequestDao
findByRepositoryAndKey
in interface VcsPullRequestDao
repositoryId
- target repository idpullRequestKey
- repository-specific pull request key@NotNull public @NotNull List<MutableVcsPullRequest> findByRepository(long repositoryId, boolean isOpen)
VcsPullRequestDao
findByRepository
in interface VcsPullRequestDao
repositoryId
- target repository idisOpen
- status@NotNull public @NotNull PartialList<MutableVcsPullRequest> closePullRequestsClosedInRepository(long targetRepositoryId, @NotNull @NotNull Set<String> openPrKeys)
VcsPullRequestDao
PartialList
of updated pull requests.
If the returned list is incomplete, this method should be called again.
closePullRequestsClosedInRepository
in interface VcsPullRequestDao
targetRepositoryId
- id of a remote repositoryopenPrKeys
- keys of pull requests which have open state in remote repository@Nullable public @Nullable MutableVcsPullRequest findById(long id)
findById
in interface VcsPullRequestDao
@NotNull public @NotNull List<MutableVcsPullRequest> findByStatus(boolean isOpen, long startId, int maxLimit)
VcsPullRequestDao
findByStatus
in interface VcsPullRequestDao
isOpen
- statusstartId
- entity id to start query frommaxLimit
- maximum amount of values to be returnedpublic int removeOrphanedPullRequests()
VcsPullRequestDao
removeOrphanedPullRequests
in interface VcsPullRequestDao
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.