com.atlassian.bamboo.variable.baseline
Class VariableContextBaselineHibernateDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate.support.HibernateDaoSupport
          extended by com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
              extended by com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<VariableContextBaseline>
                  extended by 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
VariableContextBaselineHibernateDao()
           
 
Method Summary
 int deleteOrphans()
          Delete orphaned VariableContextBaseline records.
 VariableContextBaseline findByDeploymentResultId(long deploymentResultId)
           
 VariableContextBaseline findById(long id)
           
 long iterateVariableContextBaselinesForExport(com.google.common.base.Function<VariableContextBaseline,java.lang.Void> function)
          Iterate through and execute function for each of VariableContextBaseline
 VariableContextBaseline resolveVariableContextBaseline(VariableContext variableContext)
          Searches for a context baseline with exactly the same set of variables.
 
Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectDao
delete, deleteAll, execute, executeCountQuery, executeFind, executeReturnLong, findAll, findById, save, saveAll
 
Methods inherited from class com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
getCacheAwareHibernateTemplate
 
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, 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
delete, deleteAll, executeReturnLong, findAll, findById, save, saveAll
 

Constructor Detail

VariableContextBaselineHibernateDao

public VariableContextBaselineHibernateDao()
Method Detail

findById

@Nullable
public VariableContextBaseline findById(long id)
Specified by:
findById in interface VariableContextBaselineDao

findByDeploymentResultId

@Nullable
public VariableContextBaseline findByDeploymentResultId(long deploymentResultId)
Specified by:
findByDeploymentResultId in interface VariableContextBaselineDao

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 interface VariableContextBaselineDao
Returns:
number of deleted objects

iterateVariableContextBaselinesForExport

public long iterateVariableContextBaselinesForExport(@NotNull
                                                     com.google.common.base.Function<VariableContextBaseline,java.lang.Void> function)
Description copied from interface: VariableContextBaselineDao
Iterate through and execute function for each of VariableContextBaseline

Specified by:
iterateVariableContextBaselinesForExport in interface VariableContextBaselineDao
Parameters:
function - function to be executed on each of the VariableContextBaseline
Returns:
number of traversed rows

resolveVariableContextBaseline

public VariableContextBaseline resolveVariableContextBaseline(@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 interface VariableContextBaselineDao
Returns:
existing baseline object if found


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.