public class EnvironmentDaoImpl extends BambooHibernateObjectDao<MutableEnvironment> implements EnvironmentDao
Constructor and Description |
---|
EnvironmentDaoImpl() |
Modifier and Type | Method and Description |
---|---|
long |
countAll() |
MutableEnvironment |
createNewEnvironmentInstance() |
void |
delete(MutableEnvironment environment)
Removes the given entity from the database
|
List<MutableEnvironment> |
findAll() |
List<? extends MutableEnvironment> |
findAll(int firstResult,
int maxResults) |
MutableEnvironment |
findEnvironmentByName(long deploymentProjectId,
String name)
Find environment with specified name in a deployment project
|
List<Pair<Requirement,MutableEnvironment>> |
findEnvironmentsByRequirementKey(String requirementKey)
Get requirements to environment mapping by requirement key.
|
MutableEnvironment |
getEnvironment(DeploymentKey environmentKey)
Gets specific Environment by key
|
MutableEnvironment |
getEnvironment(long environmentId)
Gets specific Environment by ID
|
int |
getEnvironmentCount() |
int |
getEnvironmentCountForProject(long deploymentProjectId) |
List<MutableEnvironment> |
getEnvironmentsForDeploymentProject(long deploymentProjectId)
Retrieve all environments for a Deployment Project
|
List<EnvironmentStub> |
getEnvironmentStubsForDeploymentProject(long deploymentProjectId)
Retrieve all environment stubs for a Deployment Project.
|
int |
getFirstEnvironmentPosition(long deploymentProjectId) |
int |
getLastEnvironmentPosition(long deploymentProjectId) |
Optional<MutableEnvironment> |
getNextEnvironment(long deploymentProjectId,
int position) |
List<MutableEnvironment> |
getPaginatedEnvironmentsForDeploymentProject(long deploymentProjectId,
int start,
int limit,
String filter)
Retrieve part of environments for a Deployment Project ordered by position
|
Optional<MutableEnvironment> |
getPreviousEnvironment(long deploymentProjectId,
int position) |
boolean |
isEnvironmentNameConflicting(MutableDeploymentProject deploymentProject,
String name)
Check if there is currently an environment with the given name in the given deployment Project.
|
void |
save(MutableEnvironment environment)
Saves the given entity.
|
void |
shiftDownEnvPosition(int fromPosition,
int toPosition,
long deploymentProjectId)
Decrement by one all environments positions for given deployment project for environments which have position greater than
fromPosition and lower than toPosition.
|
void |
shiftUpEnvPosition(int fromPosition,
int toPosition,
long deploymentProjectId)
Increment by one all environments positions for given deployment project for environments which have position greater than
fromPosition and lower than toPosition.
|
countAll, countWithRestriction, deleteAll, executeCountQuery, findAll, findById, merge, saveAll
getCacheAwareHibernateTemplate
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
saveAll
@Nullable public MutableEnvironment getEnvironment(long environmentId)
EnvironmentDao
getEnvironment
in interface EnvironmentDao
environmentId
- ID of the environment your looking for.public void save(@NotNull MutableEnvironment environment)
BambooObjectDao
EntityObject
this method will:
- update EntityObject.getLastModificationDate()
- set EntityObject.getCreationDate()
if the object has not been savedsave
in interface EnvironmentDao
save
in interface BambooObjectDao<MutableEnvironment>
save
in class BambooHibernateObjectDao<MutableEnvironment>
environment
- entity to be savedpublic void delete(@NotNull MutableEnvironment environment)
BambooObjectDao
delete
in interface EnvironmentDao
delete
in interface BambooObjectDao<MutableEnvironment>
delete
in class BambooHibernateObjectDao<MutableEnvironment>
environment
- entity to be removed@Nullable public MutableEnvironment getEnvironment(@NotNull DeploymentKey environmentKey)
EnvironmentDao
getEnvironment
in interface EnvironmentDao
environmentKey
- ket of the environment to find@NotNull public List<MutableEnvironment> getEnvironmentsForDeploymentProject(long deploymentProjectId)
EnvironmentDao
getEnvironmentsForDeploymentProject
in interface EnvironmentDao
deploymentProjectId
- of the Deployment Project@NotNull public List<EnvironmentStub> getEnvironmentStubsForDeploymentProject(long deploymentProjectId)
EnvironmentDao
getEnvironmentStubsForDeploymentProject
in interface EnvironmentDao
deploymentProjectId
- of the Deployment Projectpublic boolean isEnvironmentNameConflicting(@NotNull MutableDeploymentProject deploymentProject, @NotNull String name)
EnvironmentDao
isEnvironmentNameConflicting
in interface EnvironmentDao
deploymentProject
- the project to check environments ofname
- to check for conflict@Nullable public MutableEnvironment findEnvironmentByName(long deploymentProjectId, String name)
EnvironmentDao
findEnvironmentByName
in interface EnvironmentDao
public List<MutableEnvironment> findAll()
findAll
in interface EnvironmentDao
public int getLastEnvironmentPosition(long deploymentProjectId)
getLastEnvironmentPosition
in interface EnvironmentDao
public int getFirstEnvironmentPosition(long deploymentProjectId)
getFirstEnvironmentPosition
in interface EnvironmentDao
public int getEnvironmentCount()
getEnvironmentCount
in interface EnvironmentDao
Environment
spublic int getEnvironmentCountForProject(long deploymentProjectId)
getEnvironmentCountForProject
in interface EnvironmentDao
Environment
defined for the projectpublic long countAll()
countAll
in interface EnvironmentDao
public List<? extends MutableEnvironment> findAll(int firstResult, int maxResults)
findAll
in interface EnvironmentDao
@NotNull public List<Pair<Requirement,MutableEnvironment>> findEnvironmentsByRequirementKey(@NotNull String requirementKey)
EnvironmentDao
findEnvironmentsByRequirementKey
in interface EnvironmentDao
requirementKey
- on which environments rely@NotNull public MutableEnvironment createNewEnvironmentInstance()
createNewEnvironmentInstance
in interface EnvironmentDao
@NotNull public List<MutableEnvironment> getPaginatedEnvironmentsForDeploymentProject(long deploymentProjectId, int start, int limit, String filter)
EnvironmentDao
getPaginatedEnvironmentsForDeploymentProject
in interface EnvironmentDao
deploymentProjectId
- of the Deployment Projectstart
- startlimit
- max size of resultpublic void shiftUpEnvPosition(int fromPosition, int toPosition, long deploymentProjectId)
EnvironmentDao
shiftUpEnvPosition
in interface EnvironmentDao
public void shiftDownEnvPosition(int fromPosition, int toPosition, long deploymentProjectId)
EnvironmentDao
shiftDownEnvPosition
in interface EnvironmentDao
public Optional<MutableEnvironment> getNextEnvironment(long deploymentProjectId, int position)
getNextEnvironment
in interface EnvironmentDao
MutableEnvironment
in deploymentProject which has greater position than positionpublic Optional<MutableEnvironment> getPreviousEnvironment(long deploymentProjectId, int position)
getPreviousEnvironment
in interface EnvironmentDao
MutableEnvironment
in deploymentProject which has lower position than positionCopyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.