Class VariableContextBaselineHibernateDao
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate5.support.HibernateDaoSupport
com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
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
ConstructorDescriptionVariableContextBaselineHibernateDao
(TransactionAndHibernateTemplate transactionTemplate) -
Method Summary
Modifier and TypeMethodDescriptionint
Delete orphaned VariableContextBaseline records.@Nullable VariableContextBaseline
findByDeploymentResultId
(long deploymentResultId) @Nullable VariableContextBaseline
findById
(long id) @Nullable VariableContextBaseline
getVariableContextBaseline
(long variableContextBaselineId) long
iterateVariableContextBaselinesForExport
(@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, findById, merge, save, saveAll
Methods inherited from class com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
getCacheAwareHibernateTemplate
Methods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectDao
countAll, countWithRestriction, delete, deleteAll, findAll, findById, merge, save, saveAll
-
Constructor Details
-
VariableContextBaselineHibernateDao
-
-
Method Details
-
findById
- Specified by:
findById
in interfaceVariableContextBaselineDao
-
findByDeploymentResultId
@Nullable public @Nullable VariableContextBaseline findByDeploymentResultId(long deploymentResultId) - Specified by:
findByDeploymentResultId
in interfaceVariableContextBaselineDao
-
deleteOrphans
public int deleteOrphans()Description copied from interface:VariableContextBaselineDao
Delete orphaned VariableContextBaseline records. This should be called after removing DeploymentResult entities.- Specified by:
deleteOrphans
in interfaceVariableContextBaselineDao
- Returns:
- number of deleted objects
-
iterateVariableContextBaselinesForExport
public long iterateVariableContextBaselinesForExport(@NotNull @NotNull Consumer<VariableContextBaseline> consumer) Description copied from interface:VariableContextBaselineDao
Iterate through and execute function for each of VariableContextBaseline- Specified by:
iterateVariableContextBaselinesForExport
in 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:
getVariableContextBaseline
in interfaceVariableContextBaselineDao
-
resolveVariableContextBaseline
public VariableContextBaseline resolveVariableContextBaseline(@NotNull @NotNull VariableContext variableContext) Description copied from interface:VariableContextBaselineDao
Searches 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:
resolveVariableContextBaseline
in interfaceVariableContextBaselineDao
- Returns:
- existing baseline object if found
-