Package com.atlassian.bamboo.variable
Class VariableDefinitionHibernateDao
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate5.support.HibernateDaoSupport
com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<T>
com.atlassian.bamboo.persistence3.BambooHibernateVersionAwareObjectDao<VariableDefinition,Plan>
com.atlassian.bamboo.variable.VariableDefinitionHibernateDao
- All Implemented Interfaces:
BambooObjectDao<VariableDefinition>,VariableDefinitionDao,org.springframework.beans.factory.InitializingBean
public class VariableDefinitionHibernateDao
extends BambooHibernateVersionAwareObjectDao<VariableDefinition,Plan>
implements VariableDefinitionDao
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger -
Constructor Summary
ConstructorsConstructorDescriptionVariableDefinitionHibernateDao(TransactionAndHibernateTemplate transactionTemplate, BambooClusterSettings bambooClusterSettings) -
Method Summary
Modifier and TypeMethodDescriptionlongcountAll()@NotNull LongCount all project variables.intcountVariablesByEnvironmentId(long environmentId) Count variables associated with deployment environmentintdeleteByDeploymentVersion(@NotNull DeletionSQLAdapter deletionAdapter) Delete VariableDefinitions related to DeploymentVersions.intdeleteByEnvironment(@NotNull DeletionSQLAdapter deletionAdapter) Delete VariableDefinitions related to Environments.intdeleteByPlan(long planId) Delete VariableDefinitions related to a plan.intdeleteByProjectId(long projectId) Delete VariableDefinitions related to a project.@NotNull Collection<? extends VariableDefinition>findAll()Find all variable definitionsfindById(long id) Find variable definition of specified idfindGlobalVariableByKey(@NotNull String key) Find global variable by its key@NotNull List<VariableDefinition>Find global variable definitions.findPlanVariableByKey(@NotNull PlanIdentifier plan, @NotNull String key) Find plan variable by its key@NotNull Iterable<VariableDefinition>findVariablesByEnvironmentId(long environmentId) Find variables associated with deployment environment@NotNull List<VariableDefinition>findVariablesByPlan(@org.jetbrains.annotations.NotNull long planId) @NotNull List<VariableDefinition>findVariablesByPlan(@NotNull PlanIdentifier plan) Find plan variable definitions for a given plan@NotNull List<VariableDefinition>findVariablesByProjectId(long projectId) Find variables associated with a project@NotNull Iterable<VariableDefinition>findVariablesByVersionId(long deploymentVersionId) Find variables associated with deployment versionprotected @NotNull Optional<VersioningSupplement<Plan>>voidsave(@NotNull VariableDefinition variableDefinition) Saves the given entity.Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateVersionAwareObjectDao
delete, deleteAll, getMainVersioningSupplement, incrementMainVersion, incrementMainVersion, incrementRootVersion, incrementRootVersion, saveAllMethods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectDao
convertSearchTermToLikeExpression, countAll, countWithRestriction, executeCountQuery, findAll, findById, mergeMethods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactoryMethods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDaoMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectDao
countAll, countWithRestriction, delete, deleteAll, findAll, findById, merge, saveAll
-
Constructor Details
-
VariableDefinitionHibernateDao
public VariableDefinitionHibernateDao(TransactionAndHibernateTemplate transactionTemplate, BambooClusterSettings bambooClusterSettings)
-
-
Method Details
-
getRootVersioningSupplement
- Overrides:
getRootVersioningSupplementin classBambooHibernateVersionAwareObjectDao<VariableDefinition,Plan>
-
findById
Description copied from interface:VariableDefinitionDaoFind variable definition of specified id- Specified by:
findByIdin interfaceVariableDefinitionDao- Parameters:
id- id of variable definition- Returns:
- variable definition of specified id or null if not found
-
findGlobalVariables
Description copied from interface:VariableDefinitionDaoFind global variable definitions.- Specified by:
findGlobalVariablesin interfaceVariableDefinitionDao- Returns:
- global variable definition collection
-
findAllProjectIdsUsingProjectVariables
- Specified by:
findAllProjectIdsUsingProjectVariablesin interfaceVariableDefinitionDao- Returns:
- all project variables definitions collection
-
countAllProjectVariables
Description copied from interface:VariableDefinitionDaoCount all project variables.- Specified by:
countAllProjectVariablesin interfaceVariableDefinitionDao- Returns:
- Long count of project variables.
-
save
Description copied from interface:BambooObjectDaoSaves the given entity. If the entity implementation is an instance ofEntityObjectthis method will: - updateEntityObject.getLastModificationDate()- setEntityObject.getCreationDate()if the object has not been saved- Specified by:
savein interfaceBambooObjectDao<VariableDefinition>- Overrides:
savein classBambooHibernateVersionAwareObjectDao<VariableDefinition,Plan> - Parameters:
variableDefinition- entity to be saved
-
findVariablesByPlan
@NotNull public @NotNull List<VariableDefinition> findVariablesByPlan(@NotNull @NotNull PlanIdentifier plan) Description copied from interface:VariableDefinitionDaoFind plan variable definitions for a given plan- Specified by:
findVariablesByPlanin interfaceVariableDefinitionDao- Parameters:
plan- plan which associated variable definition should be retrieved- Returns:
- variable definition matching plan or empty collection if not found
-
findVariablesByPlan
@NotNull public @NotNull List<VariableDefinition> findVariablesByPlan(@NotNull @org.jetbrains.annotations.NotNull long planId) - Specified by:
findVariablesByPlanin interfaceVariableDefinitionDao
-
countVariablesByEnvironmentId
public int countVariablesByEnvironmentId(long environmentId) Description copied from interface:VariableDefinitionDaoCount variables associated with deployment environment- Specified by:
countVariablesByEnvironmentIdin interfaceVariableDefinitionDao- Parameters:
environmentId- id of a deployment environment- Returns:
- number of variables found
-
findVariablesByEnvironmentId
@NotNull public @NotNull Iterable<VariableDefinition> findVariablesByEnvironmentId(long environmentId) Description copied from interface:VariableDefinitionDaoFind variables associated with deployment environment- Specified by:
findVariablesByEnvironmentIdin interfaceVariableDefinitionDao- Parameters:
environmentId- id of a deployment environment- Returns:
- list of variables found
-
findVariablesByVersionId
@NotNull public @NotNull Iterable<VariableDefinition> findVariablesByVersionId(long deploymentVersionId) Description copied from interface:VariableDefinitionDaoFind variables associated with deployment version- Specified by:
findVariablesByVersionIdin interfaceVariableDefinitionDao- Parameters:
deploymentVersionId- id of a deployment version- Returns:
- list of variables found
-
findVariablesByProjectId
Description copied from interface:VariableDefinitionDaoFind variables associated with a project- Specified by:
findVariablesByProjectIdin interfaceVariableDefinitionDao- Parameters:
projectId- id of a project- Returns:
- list of variables found
-
deleteByEnvironment
Description copied from interface:VariableDefinitionDaoDelete VariableDefinitions related to Environments.- Specified by:
deleteByEnvironmentin interfaceVariableDefinitionDao- Parameters:
deletionAdapter-DeletionSQLAdapter.getInClause()- Returns:
-
deleteByDeploymentVersion
Description copied from interface:VariableDefinitionDaoDelete VariableDefinitions related to DeploymentVersions.- Specified by:
deleteByDeploymentVersionin interfaceVariableDefinitionDao
-
deleteByPlan
public int deleteByPlan(long planId) Description copied from interface:VariableDefinitionDaoDelete VariableDefinitions related to a plan.- Specified by:
deleteByPlanin interfaceVariableDefinitionDao- Returns:
- deleted rows count
-
deleteByProjectId
public int deleteByProjectId(long projectId) Description copied from interface:VariableDefinitionDaoDelete VariableDefinitions related to a project.- Specified by:
deleteByProjectIdin interfaceVariableDefinitionDao- Returns:
- deleted rows count
-
findPlanVariableByKey
public VariableDefinition findPlanVariableByKey(@NotNull @NotNull PlanIdentifier plan, @NotNull @NotNull String key) Description copied from interface:VariableDefinitionDaoFind plan variable by its key- Specified by:
findPlanVariableByKeyin interfaceVariableDefinitionDao- Parameters:
plan- plan used to filter variableskey- key which identifies plan variable definition- Returns:
- variable definition or null if not found
-
findGlobalVariableByKey
Description copied from interface:VariableDefinitionDaoFind global variable by its key- Specified by:
findGlobalVariableByKeyin interfaceVariableDefinitionDao- Parameters:
key- key which identifies global variable definition- Returns:
- variable definition or null if not found
-
findAll
Description copied from interface:VariableDefinitionDaoFind all variable definitions- Specified by:
findAllin interfaceVariableDefinitionDao- Returns:
- Collection of all variable definitions
-
countAll
public long countAll()- Specified by:
countAllin interfaceVariableDefinitionDao
-