public class DeploymentVersionDaoImpl extends StatelessSessionHibernateDaoSupport implements DeploymentVersionDao
Constructor and Description |
---|
DeploymentVersionDaoImpl(TransactionAndHibernateTemplate transactionTemplate) |
Modifier and Type | Method and Description |
---|---|
MutableDeploymentVersionStatus |
createNewVersionStatus(long deploymentVersionId,
DeploymentVersionState state,
String userName)
Creates a new vesion status for the given deployment version.
|
void |
delete(MutableDeploymentVersion deploymentVersion)
Delete MutableDeploymentVersion
|
int |
deleteForDeploymentProject(long deploymentProjectId)
Affected tables:
- DEPLOYMENT_VERSION (manual, JDBC)
- DEPLOYMENT_VERSION_ITEM (manual, JDBC)
- DEPLOYMENT_VERSION_ITEM_BA (manual, JDBC)
- DEPLOYMENT_PLANRESULTKEYS (manual, JDBC)
|
int |
deleteVersionItems(long deploymentVersionId)
Affected tables:
- DEPLOYMENT_VERSION_ITEM (manual, JDBC)
- DEPLOYMENT_VERSION_ITEM_BA (manual, JDBC)
|
int |
deleteVersionStatus(long deploymentVersionId)
Delete DeploymentVersionStatus records related to a given version
|
int |
deleteVersionStatuses(DeploymentVersionDeletionAdapter deletionAdapter)
Delete DeploymentVersionStatus records related to a given versions
|
List<MutableDeploymentVersion> |
findLatestKnownVersionsForEnvironmentsOfDeploymentProject(long deploymentProjectId)
Find all the versions that are currently deployed on environments of a deployment projects.
|
MutableDeploymentVersion |
findLatestVersionForProject(long deploymentProjectId)
Find the latest version for a deployment project.
|
MutableDeploymentVersion |
findLatestVersionForProject(long deploymentProjectId,
PlanKey branchKey)
Find the latest version for a deployment project.
|
MutableDeploymentVersion |
findNextVersionContainingResult(long deploymentProjectId,
PlanResultKey planResultKey)
Find the first version that is created from a result which is later than current result (not taking custom revision into account)
|
MutableDeploymentVersion |
findPreviousVersion(long deploymentProjectId,
MutableDeploymentVersion deploymentVersion)
Find the last version created before this one.
|
List<MutableDeploymentVersion> |
findVersions(DeploymentVersionSearchCriteria searchCriteria)
Search for versions using search criteria
|
List<MutableDeploymentVersion> |
findVersionsAssociatedWithJiraIssue(long deploymentProjectId,
String issueKey)
Find all the versions of a
DeploymentProject that are associated with a JIRA issue |
List<MutableDeploymentVersion> |
findVersionsAssociatedWithJiraIssue(String issueKey)
Find all the versions that are associated with a JIRA issue
|
Iterable<MutableDeploymentVersion> |
findVersionsBetween(long deploymentProjectId,
long version1Id,
long version2Id)
Find versions created between version1 and version2.
|
MutableDeploymentVersion |
getDeploymentVersion(long deploymentVersionId)
Get MutableDeploymentVersion by id
|
MutableDeploymentVersion |
getDeploymentVersionByName(String existingVersionName,
long deploymentProjectId)
Retrieve a specific version by name for a project
|
List<MutableDeploymentVersion> |
getDeploymentVersionsForDeploymentProject(long deploymentProjectId)
Get MutableDeploymentVersion by DeploymentProject id
|
MutableDeploymentVersionStatus |
getLatestVersionStatus(long deploymentVersionId) |
Set<PlanResultKey> |
getRelatedPlanResultKeys(long deploymentVersionId) |
MutableDeploymentVersion |
getRelatedVersion(long deploymentProjectId,
PlanResultKey planResultKey)
Find latest version of a deployment project that is related to specific plan result.
|
List<String> |
getResultPlanKeysHavingDeploymentProjectVersions(long deploymentProjectId)
Returns keys of result plans (branch) that have at least one deployment project version (release)
|
int |
getVersionsCount()
Count all versions
|
int |
getVersionsCountForProject(long deploymentProjectId)
Count versions related to deployment project
|
List<MutableDeploymentVersionStatus> |
getVersionStatuses(long deploymentVersionId)
Get
MutableDeploymentVersionStatus es by DeploymentVersion id |
boolean |
hasVersions(DeploymentVersionSearchCriteria searchCriteria)
Test if versions that match criteria do exist
|
boolean |
isVersionNameConflicting(String name,
long deploymentProjectId)
Check whether the version name is already being used by another version within this project
|
void |
save(MutableDeploymentVersion deploymentVersion)
MutableDeploymentVersionItem members of
MutableDeploymentVersion.getItems() are persisted in a cascade |
void |
updatePlanKey(PlanKey originalPlanKey,
PlanKey newPlanKey)
Update planKey in DeploymentVersion's related entities when plan key has changed (ie after moving plan)
|
getCacheAwareHibernateTemplate
public DeploymentVersionDaoImpl(TransactionAndHibernateTemplate transactionTemplate)
public List<String> getResultPlanKeysHavingDeploymentProjectVersions(long deploymentProjectId)
DeploymentVersionDao
getResultPlanKeysHavingDeploymentProjectVersions
in interface DeploymentVersionDao
deploymentProjectId
- id of the deployment project@NotNull public List<MutableDeploymentVersion> getDeploymentVersionsForDeploymentProject(long deploymentProjectId)
DeploymentVersionDao
getDeploymentVersionsForDeploymentProject
in interface DeploymentVersionDao
public MutableDeploymentVersion getDeploymentVersion(long deploymentVersionId)
DeploymentVersionDao
getDeploymentVersion
in interface DeploymentVersionDao
public void save(@NotNull MutableDeploymentVersion deploymentVersion)
MutableDeploymentVersion.getItems()
are persisted in a cascadesave
in interface DeploymentVersionDao
deploymentVersion
- MutableDeploymentVersion to be persistedpublic void delete(MutableDeploymentVersion deploymentVersion)
DeploymentVersionDao
delete
in interface DeploymentVersionDao
public int deleteForDeploymentProject(long deploymentProjectId)
deleteForDeploymentProject
in interface DeploymentVersionDao
deploymentProjectId
- id of DeploymentProjectpublic int deleteVersionItems(long deploymentVersionId)
deleteVersionItems
in interface DeploymentVersionDao
deploymentVersionId
- id of DeploymentVersion@NotNull public List<MutableDeploymentVersion> findVersions(@NotNull DeploymentVersionSearchCriteria searchCriteria)
DeploymentVersionDao
findVersions
in interface DeploymentVersionDao
searchCriteria
- search criteriapublic boolean hasVersions(@NotNull DeploymentVersionSearchCriteria searchCriteria)
DeploymentVersionDao
hasVersions
in interface DeploymentVersionDao
searchCriteria
- search criteriapublic boolean isVersionNameConflicting(@NotNull String name, long deploymentProjectId)
DeploymentVersionDao
isVersionNameConflicting
in interface DeploymentVersionDao
name
- to checkdeploymentProjectId
- project to filter by@Nullable public MutableDeploymentVersion getDeploymentVersionByName(@NotNull String existingVersionName, long deploymentProjectId)
DeploymentVersionDao
getDeploymentVersionByName
in interface DeploymentVersionDao
existingVersionName
- name of version to finddeploymentProjectId
- of project to look in@Nullable public MutableDeploymentVersion findPreviousVersion(long deploymentProjectId, @NotNull MutableDeploymentVersion deploymentVersion)
DeploymentVersionDao
findPreviousVersion
in interface DeploymentVersionDao
@Nullable public MutableDeploymentVersion findLatestVersionForProject(long deploymentProjectId)
DeploymentVersionDao
findLatestVersionForProject
in interface DeploymentVersionDao
deploymentProjectId
- id of the deployment project@Nullable public MutableDeploymentVersion findLatestVersionForProject(long deploymentProjectId, @NotNull PlanKey branchKey)
DeploymentVersionDao
findLatestVersionForProject
in interface DeploymentVersionDao
deploymentProjectId
- id of the deployment projectbranchKey
- key of the PlanBranch@NotNull public Set<PlanResultKey> getRelatedPlanResultKeys(long deploymentVersionId)
getRelatedPlanResultKeys
in interface DeploymentVersionDao
@Nullable public MutableDeploymentVersionStatus getLatestVersionStatus(long deploymentVersionId)
getLatestVersionStatus
in interface DeploymentVersionDao
@NotNull public MutableDeploymentVersionStatus createNewVersionStatus(long deploymentVersionId, DeploymentVersionState state, @NotNull String userName)
DeploymentVersionDao
createNewVersionStatus
in interface DeploymentVersionDao
@Nullable public MutableDeploymentVersion getRelatedVersion(long deploymentProjectId, @NotNull PlanResultKey planResultKey)
DeploymentVersionDao
getRelatedVersion
in interface DeploymentVersionDao
public MutableDeploymentVersion findNextVersionContainingResult(long deploymentProjectId, @NotNull PlanResultKey planResultKey)
DeploymentVersionDao
findNextVersionContainingResult
in interface DeploymentVersionDao
@NotNull public List<MutableDeploymentVersionStatus> getVersionStatuses(long deploymentVersionId)
DeploymentVersionDao
MutableDeploymentVersionStatus
es by DeploymentVersion idgetVersionStatuses
in interface DeploymentVersionDao
public Iterable<MutableDeploymentVersion> findVersionsBetween(long deploymentProjectId, long version1Id, long version2Id)
DeploymentVersionDao
findVersionsBetween
in interface DeploymentVersionDao
@NotNull public List<MutableDeploymentVersion> findVersionsAssociatedWithJiraIssue(long deploymentProjectId, @NotNull String issueKey)
DeploymentVersionDao
DeploymentProject
that are associated with a JIRA issuefindVersionsAssociatedWithJiraIssue
in interface DeploymentVersionDao
@NotNull public List<MutableDeploymentVersion> findVersionsAssociatedWithJiraIssue(@NotNull String issueKey)
DeploymentVersionDao
findVersionsAssociatedWithJiraIssue
in interface DeploymentVersionDao
public List<MutableDeploymentVersion> findLatestKnownVersionsForEnvironmentsOfDeploymentProject(long deploymentProjectId)
DeploymentVersionDao
findLatestKnownVersionsForEnvironmentsOfDeploymentProject
in interface DeploymentVersionDao
public int deleteVersionStatus(long deploymentVersionId)
DeploymentVersionDao
deleteVersionStatus
in interface DeploymentVersionDao
deploymentVersionId
- id of the DeploymentVersionpublic int deleteVersionStatuses(@NotNull DeploymentVersionDeletionAdapter deletionAdapter)
DeploymentVersionDao
deleteVersionStatuses
in interface DeploymentVersionDao
deletionAdapter
- DeletionSQLAdapter.getInClause()
should provide range of DeploymentVersions to removepublic int getVersionsCount()
DeploymentVersionDao
getVersionsCount
in interface DeploymentVersionDao
public int getVersionsCountForProject(long deploymentProjectId)
DeploymentVersionDao
getVersionsCountForProject
in interface DeploymentVersionDao
deploymentProjectId
- id of deployment projectpublic void updatePlanKey(@NotNull PlanKey originalPlanKey, @NotNull PlanKey newPlanKey)
DeploymentVersionDao
updatePlanKey
in interface DeploymentVersionDao
originalPlanKey
- original PlanKeynewPlanKey
- new PlanKeyCopyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.