Class VariableContextBaselineHibernateDao
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate5.support.HibernateDaoSupport
com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<VariableContextBaseline>
com.atlassian.bamboo.variable.baseline.VariableContextBaselineHibernateDao
- All Implemented Interfaces:
BambooObjectDao<VariableContextBaseline>,VariableContextBaselineDao,org.springframework.beans.factory.InitializingBean
public class VariableContextBaselineHibernateDao
extends BambooHibernateObjectDao<VariableContextBaseline>
implements VariableContextBaselineDao
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger -
Constructor Summary
ConstructorsConstructorDescriptionVariableContextBaselineHibernateDao(TransactionAndHibernateTemplate transactionTemplate) -
Method Summary
Modifier and TypeMethodDescriptionintDelete orphaned VariableContextBaseline records.@Nullable VariableContextBaselinefindByDeploymentResultId(long deploymentResultId) @Nullable VariableContextBaselinefindById(long id) @Nullable VariableContextBaselinegetVariableContextBaseline(long variableContextBaselineId) longiterateVariableContextBaselinesForExport(@NotNull Consumer<VariableContextBaseline> consumer) Iterate through and execute function for each of VariableContextBaselineresolveVariableContextBaseline(@NotNull VariableContext variableContext) Searches for a context baseline with exactly the same set of variables.Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectDao
convertSearchTermToLikeExpression, countAll, countWithRestriction, delete, deleteAll, executeCountQuery, findAll, findAll, findById, merge, save, saveAllMethods 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, initDao
-
Constructor Details
-
VariableContextBaselineHibernateDao
-
-
Method Details
-
findById
- Specified by:
findByIdin interfaceVariableContextBaselineDao
-
findByDeploymentResultId
@Nullable public @Nullable VariableContextBaseline findByDeploymentResultId(long deploymentResultId) - Specified by:
findByDeploymentResultIdin interfaceVariableContextBaselineDao
-
deleteOrphans
public int deleteOrphans()Description copied from interface:VariableContextBaselineDaoDelete orphaned VariableContextBaseline records. This should be called after removing DeploymentResult entities.- Specified by:
deleteOrphansin interfaceVariableContextBaselineDao- Returns:
- number of deleted objects
-
iterateVariableContextBaselinesForExport
public long iterateVariableContextBaselinesForExport(@NotNull @NotNull Consumer<VariableContextBaseline> consumer) Description copied from interface:VariableContextBaselineDaoIterate through and execute function for each of VariableContextBaseline- Specified by:
iterateVariableContextBaselinesForExportin interfaceVariableContextBaselineDao- Parameters:
consumer- consumer to accept each of the VariableContextBaseline- Returns:
- number of traversed rows
-
getVariableContextBaseline
@Nullable public @Nullable VariableContextBaseline getVariableContextBaseline(long variableContextBaselineId) - Specified by:
getVariableContextBaselinein interfaceVariableContextBaselineDao
-
resolveVariableContextBaseline
public VariableContextBaseline resolveVariableContextBaseline(@NotNull @NotNull VariableContext variableContext) Description copied from interface:VariableContextBaselineDaoSearches for a context baseline with exactly the same set of variables. If not found and variable context not empty, new baseline object is created. Method returns null iff variableContext is empty. For performance reasons, search algorithm does not guarantee that it will always find a matching baseline when it exists: it may be limited to recent baseline(s) only.- Specified by:
resolveVariableContextBaselinein interfaceVariableContextBaselineDao- Returns:
- existing baseline object if found
-