public class VcsPullRequestHibernateDao extends BambooHibernateObjectDao<MutableVcsPullRequest> implements VcsPullRequestDao
| Constructor and Description |
|---|
VcsPullRequestHibernateDao() |
| Modifier and Type | Method and Description |
|---|---|
PartialList<MutableVcsPullRequest> |
closePullRequestsClosedInRepository(long targetRepositoryId,
Set<String> openPrKeys)
Synchronize status of PRs in DB and in remote repository.
|
Collection<? extends MutableVcsPullRequest> |
findAll() |
MutableVcsPullRequest |
findById(long id) |
List<MutableVcsPullRequest> |
findByRepository(long repositoryId,
boolean isOpen)
Search pull requests by target repository and status.
|
MutableVcsPullRequest |
findByRepositoryAndKey(long repositoryId,
String pullRequestKey)
Search pull request by pull request key (unique on repository level) and target repository id
|
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, saveAllgetCacheAwareHibernateTemplatecheckDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcountAll, countWithRestriction, delete, deleteAll, findAll, findById, merge, save, saveAllpublic Collection<? extends MutableVcsPullRequest> findAll()
findAll in interface VcsPullRequestDao@Nullable public MutableVcsPullRequest findByRepositoryAndKey(long repositoryId, @NotNull String pullRequestKey)
VcsPullRequestDaofindByRepositoryAndKey in interface VcsPullRequestDaorepositoryId - target repository idpullRequestKey - repository-specific pull request key@NotNull public List<MutableVcsPullRequest> findByRepository(long repositoryId, boolean isOpen)
VcsPullRequestDaofindByRepository in interface VcsPullRequestDaorepositoryId - target repository idisOpen - status@NotNull public PartialList<MutableVcsPullRequest> closePullRequestsClosedInRepository(long targetRepositoryId, @NotNull Set<String> openPrKeys)
VcsPullRequestDaoPartialList of updated pull requests.
If the returned list is incomplete, this method should be called again.
closePullRequestsClosedInRepository in interface VcsPullRequestDaotargetRepositoryId - id of a remote repositoryopenPrKeys - keys of pull requests which have open state in remote repository@Nullable public MutableVcsPullRequest findById(long id)
findById in interface VcsPullRequestDao@NotNull public List<MutableVcsPullRequest> findByStatus(boolean isOpen, long startId, int maxLimit)
VcsPullRequestDaofindByStatus in interface VcsPullRequestDaoisOpen - statusstartId - entity id to start query frommaxLimit - maximum amount of values to be returnedpublic int removeOrphanedPullRequests()
VcsPullRequestDaoremoveOrphanedPullRequests in interface VcsPullRequestDaoCopyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.