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, 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 MutableVcsPullRequest findByRepositoryAndKey(long repositoryId, @NotNull String pullRequestKey)
VcsPullRequestDao
findByRepositoryAndKey
in interface VcsPullRequestDao
repositoryId
- target repository idpullRequestKey
- repository-specific pull request key@NotNull public List<MutableVcsPullRequest> findByRepository(long repositoryId, boolean isOpen)
VcsPullRequestDao
findByRepository
in interface VcsPullRequestDao
repositoryId
- target repository idisOpen
- status@NotNull public PartialList<MutableVcsPullRequest> closePullRequestsClosedInRepository(long targetRepositoryId, @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 MutableVcsPullRequest findById(long id)
findById
in interface VcsPullRequestDao
@NotNull public 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 © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.