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
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
-
Constructor Summary
ConstructorDescriptionEnvironmentRepositoryLinkHibernateDao
(TransactionAndHibernateTemplate transactionTemplate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
detachAllRepositoriesFromEnvironment
(@NotNull InternalEnvironment environment) Remove allPlanRepositoryLink
defined for theEnvironment
.void
detachAllRepositoriesFromEnvironment
(@NotNull EnvironmentDeletionAdapter deletionAdapter) Remove allPlanRepositoryLink
defined for theEnvironment
.@Nullable EnvironmentRepositoryLink
getEnvironmentRepositoryLink
(@NotNull InternalEnvironment environment, long repositoryId) @NotNull List<EnvironmentRepositoryLink>
getEnvironmentRepositoryLinks
(@NotNull InternalEnvironment environment) @NotNull List<EnvironmentRepositoryLink>
getEnvironmentRepositoryLinksForRepository
(long repositoryId) @NotNull List<MutableEnvironment>
getEnvironmentsUsingRepository
(long repositoryId) linkRepositoryToEnvironment
(MutableEnvironment environment, RepositoryDataEntity repositoryDataEntity, int index) Creates and saves connection between repository and and a deployment environment.void
removeRepositoryFromEnvironment
(@NotNull EnvironmentRepositoryLink environmentRepositoryLink) Remove singlePlanRepositoryLink
.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
-
EnvironmentRepositoryLinkHibernateDao
-
-
Method Details
-
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
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
- 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:
-