Class EnvironmentRepositoryLinkHibernateDao
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- org.springframework.orm.hibernate5.support.HibernateDaoSupport
-
- com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
-
- com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<EnvironmentRepositoryLink>
-
- com.atlassian.bamboo.deployments.repository.persistence.EnvironmentRepositoryLinkHibernateDao
-
- All Implemented Interfaces:
EnvironmentRepositoryLinkDao
,BambooObjectDao<EnvironmentRepositoryLink>
,org.springframework.beans.factory.InitializingBean
public class EnvironmentRepositoryLinkHibernateDao extends BambooHibernateObjectDao<EnvironmentRepositoryLink> implements EnvironmentRepositoryLinkDao
-
-
Constructor Summary
Constructors Constructor Description EnvironmentRepositoryLinkHibernateDao(TransactionAndHibernateTemplate transactionTemplate)
-
Method Summary
-
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 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 Detail
-
EnvironmentRepositoryLinkHibernateDao
public EnvironmentRepositoryLinkHibernateDao(TransactionAndHibernateTemplate transactionTemplate)
-
-
Method Detail
-
getEnvironmentRepositoryLinks
@NotNull public @NotNull List<EnvironmentRepositoryLink> getEnvironmentRepositoryLinks(@NotNull @NotNull InternalEnvironment environment)
- Specified by:
getEnvironmentRepositoryLinks
in interfaceEnvironmentRepositoryLinkDao
- Returns:
- list of Source Repository relationships defined for the
Environment
sorted byEnvironmentRepositoryLink.getPosition()
-
getEnvironmentRepositoryLinksForRepository
@NotNull public @NotNull List<EnvironmentRepositoryLink> getEnvironmentRepositoryLinksForRepository(long repositoryId)
- Specified by:
getEnvironmentRepositoryLinksForRepository
in interfaceEnvironmentRepositoryLinkDao
- Returns:
- list of Source Repository relationships defined for the given repository
-
getEnvironmentRepositoryLink
@Nullable public @Nullable EnvironmentRepositoryLink getEnvironmentRepositoryLink(@NotNull @NotNull InternalEnvironment environment, long repositoryId)
- Specified by:
getEnvironmentRepositoryLink
in interfaceEnvironmentRepositoryLinkDao
- Returns:
- relationship between entity and repository if it exists, null otherwise
-
detachAllRepositoriesFromEnvironment
public void detachAllRepositoriesFromEnvironment(@NotNull @NotNull InternalEnvironment environment)
Description copied from interface:EnvironmentRepositoryLinkDao
Remove allPlanRepositoryLink
defined for theEnvironment
. Does not deleteRepositoryDataEntity
objects.- Specified by:
detachAllRepositoriesFromEnvironment
in interfaceEnvironmentRepositoryLinkDao
-
detachAllRepositoriesFromEnvironment
public void detachAllRepositoriesFromEnvironment(@NotNull @NotNull EnvironmentDeletionAdapter deletionAdapter)
Description copied from interface:EnvironmentRepositoryLinkDao
Remove allPlanRepositoryLink
defined for theEnvironment
. Does not deleteRepositoryDataEntity
objects.- Specified by:
detachAllRepositoriesFromEnvironment
in interfaceEnvironmentRepositoryLinkDao
-
removeRepositoryFromEnvironment
public void removeRepositoryFromEnvironment(@NotNull @NotNull EnvironmentRepositoryLink environmentRepositoryLink)
Description copied from interface:EnvironmentRepositoryLinkDao
Remove singlePlanRepositoryLink
. Does not deleteRepositoryDataEntity
- Specified by:
removeRepositoryFromEnvironment
in interfaceEnvironmentRepositoryLinkDao
-
getEnvironmentsUsingRepository
@NotNull public @NotNull List<MutableEnvironment> getEnvironmentsUsingRepository(long repositoryId)
- Specified by:
getEnvironmentsUsingRepository
in interfaceEnvironmentRepositoryLinkDao
- Parameters:
repositoryId
- repository id- Returns:
- list of
Environment
s using given repository
-
linkRepositoryToEnvironment
public EnvironmentRepositoryLink linkRepositoryToEnvironment(MutableEnvironment environment, RepositoryDataEntity repositoryDataEntity, int index)
Description copied from interface:EnvironmentRepositoryLinkDao
Creates and saves connection between repository and and a deployment environment.- Specified by:
linkRepositoryToEnvironment
in interfaceEnvironmentRepositoryLinkDao
- Returns:
-
-