com.atlassian.bamboo.repository
Class PlanRepositoryLinkHibernateDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
              extended by com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<PlanRepositoryLink>
                  extended by com.atlassian.bamboo.repository.PlanRepositoryLinkHibernateDao
All Implemented Interfaces:
BambooObjectDao<PlanRepositoryLink>, PlanRepositoryLinkDao, org.springframework.beans.factory.InitializingBean

public class PlanRepositoryLinkHibernateDao
extends BambooHibernateObjectDao<PlanRepositoryLink>
implements PlanRepositoryLinkDao


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
PlanRepositoryLinkHibernateDao()
           
 
Method Summary
 void detachAllRepositoriesFromPlan(ImmutablePlan plan)
          Remove all PlanRepositoryLink defined for the .
 List<PlanIdentifier> getIdentifiersOfPlansUsingRepository(long repositoryId)
          Get identifiers of Plans referencing a repository.
 PlanRepositoryLink getPlanRepositoryLink(PlanIdentifier plan, long repositoryId)
           
 List<PlanRepositoryLink> getPlanRepositoryLinks(ImmutablePlan plan)
           
 List<PlanRepositoryLink> getPlansUsingRepository(long repositoryId)
           
 void removeRepositoryFromPlan(PlanRepositoryLink planRepository)
          Remove single PlanRepositoryLink.
 
Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectDao
countAll, countWithRestriction, delete, deleteAll, execute, executeCountQuery, executeReturnInt, executeReturnLong, findAll, findById, save, saveAll
 
Methods inherited from class com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
getCacheAwareHibernateTemplate
 
Methods inherited from class org.springframework.orm.hibernate3.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
countAll, countWithRestriction, delete, deleteAll, executeReturnInt, executeReturnLong, findAll, findById, save, saveAll
 

Constructor Detail

PlanRepositoryLinkHibernateDao

public PlanRepositoryLinkHibernateDao()
Method Detail

getPlanRepositoryLinks

@NotNull
public List<PlanRepositoryLink> getPlanRepositoryLinks(@NotNull
                                                               ImmutablePlan plan)
Specified by:
getPlanRepositoryLinks in interface PlanRepositoryLinkDao
Returns:
list of Source Repository relationships defined for the Plan sorted by PlanRepositoryLink.getPosition()

getPlansUsingRepository

public List<PlanRepositoryLink> getPlansUsingRepository(long repositoryId)
Specified by:
getPlansUsingRepository in interface PlanRepositoryLinkDao
Returns:
list of Plan that reference a Source Repository

getIdentifiersOfPlansUsingRepository

public List<PlanIdentifier> getIdentifiersOfPlansUsingRepository(long repositoryId)
Description copied from interface: PlanRepositoryLinkDao
Get identifiers of Plans referencing a repository. This is faster than getPlansUsingRepository() and should be preferred for 'view' actions.

Specified by:
getIdentifiersOfPlansUsingRepository in interface PlanRepositoryLinkDao
Returns:

getPlanRepositoryLink

public PlanRepositoryLink getPlanRepositoryLink(@NotNull
                                                PlanIdentifier plan,
                                                long repositoryId)
Specified by:
getPlanRepositoryLink in interface PlanRepositoryLinkDao
Returns:
relationship between plan and repository if it exists, null otherwise

detachAllRepositoriesFromPlan

public void detachAllRepositoriesFromPlan(@NotNull
                                          ImmutablePlan plan)
Description copied from interface: PlanRepositoryLinkDao
Remove all PlanRepositoryLink defined for the . Does not delete RepositoryDataEntity objects.

Specified by:
detachAllRepositoriesFromPlan in interface PlanRepositoryLinkDao

removeRepositoryFromPlan

public void removeRepositoryFromPlan(@NotNull
                                     PlanRepositoryLink planRepository)
Description copied from interface: PlanRepositoryLinkDao
Remove single PlanRepositoryLink. Does not delete RepositoryDataEntity

Specified by:
removeRepositoryFromPlan in interface PlanRepositoryLinkDao


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.