Package com.atlassian.bamboo.repository
Class PlanRepositoryLinkHibernateDao
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate5.support.HibernateDaoSupport
com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<T>
com.atlassian.bamboo.persistence3.BambooHibernateVersionAwareObjectDao<PlanRepositoryLink,Plan>
com.atlassian.bamboo.repository.PlanRepositoryLinkHibernateDao
- All Implemented Interfaces:
BambooObjectDao<PlanRepositoryLink>,PlanRepositoryLinkDao,org.springframework.beans.factory.InitializingBean
public class PlanRepositoryLinkHibernateDao
extends BambooHibernateVersionAwareObjectDao<PlanRepositoryLink,Plan>
implements PlanRepositoryLinkDao
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger -
Constructor Summary
ConstructorsConstructorDescriptionPlanRepositoryLinkHibernateDao(@NotNull BambooClusterSettings bambooClusterSettings) -
Method Summary
Modifier and TypeMethodDescriptionvoiddetachAllRepositoriesFromPlan(@NotNull ImmutablePlan plan) Remove allPlanRepositoryLinkdefined for the .@NotNull List<PlanRepositoryLinkDto>Find all in DTO formgetIdentifiersOfPlansUsingRepository(long repositoryId) Get identifiers of Plans referencing a repository.getIdentifiersOfPlansUsingRepositoryOrItsDirectChildren(long repositoryId) Get identifiers of Plans referencing a repository, either directly or through inheritance (only direct parent-child relationship is checked)getPlanRepositoryLink(@NotNull PlanIdentifier plan, long repositoryId) getPlanRepositoryLinkByName(@NotNull PlanIdentifier plan, @NotNull String repositoryName) @NotNull List<PlanRepositoryLinkDto>getPlanRepositoryLinkDtos(@NotNull PlanIdentifier plan) @NotNull List<PlanRepositoryLink>getPlanRepositoryLinks(@NotNull ImmutablePlan plan) @NotNull List<PlanRepositoryLink>getPlanRepositoryLinks(@NotNull PlanIdentifier plan) getPlansUsingRepository(long repositoryId) protected @NotNull Optional<VersioningSupplement<Plan>>booleanisRepositoryOrItsDirectChildrenUsedInPlans(long repositoryId) Check if repository is used in plansvoidremoveLinksByParentRepositoryId(long parentId) Removes all link objects where repository is direct child of a repository with given id.voidremoveRepositoryFromPlan(@NotNull PlanRepositoryLink planRepository) Remove singlePlanRepositoryLink.Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateVersionAwareObjectDao
delete, deleteAll, getMainVersioningSupplement, incrementMainVersion, incrementMainVersion, incrementRootVersion, incrementRootVersion, save, saveAllMethods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectDao
convertSearchTermToLikeExpression, countAll, countWithRestriction, executeCountQuery, findAll, findById, mergeMethods inherited from class com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
getCacheAwareHibernateTemplateMethods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactoryMethods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDaoMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectDao
countAll, countWithRestriction, delete, deleteAll, findAll, findById, merge, save, saveAll
-
Constructor Details
-
PlanRepositoryLinkHibernateDao
public PlanRepositoryLinkHibernateDao(@NotNull @NotNull BambooClusterSettings bambooClusterSettings)
-
-
Method Details
-
getPlanRepositoryLinks
@NotNull public @NotNull List<PlanRepositoryLink> getPlanRepositoryLinks(@NotNull @NotNull ImmutablePlan plan) - Specified by:
getPlanRepositoryLinksin interfacePlanRepositoryLinkDao- Returns:
- list of Source Repository relationships defined for the
Plansorted byPlanRepositoryLink.getPosition()
-
getRootVersioningSupplement
- Overrides:
getRootVersioningSupplementin classBambooHibernateVersionAwareObjectDao<PlanRepositoryLink,Plan>
-
getPlanRepositoryLinks
@NotNull public @NotNull List<PlanRepositoryLink> getPlanRepositoryLinks(@NotNull @NotNull PlanIdentifier plan) - Specified by:
getPlanRepositoryLinksin interfacePlanRepositoryLinkDao- Returns:
- list of Source Repository relationships defined for the
Plansorted byPlanRepositoryLink.getPosition()
-
getPlanRepositoryLinkDtos
@NotNull public @NotNull List<PlanRepositoryLinkDto> getPlanRepositoryLinkDtos(@NotNull @NotNull PlanIdentifier plan) - Specified by:
getPlanRepositoryLinkDtosin interfacePlanRepositoryLinkDao- Returns:
- list of Source Repository relationships defined for the
Plansorted byPlanRepositoryLink.getPosition()
-
getPlansUsingRepository
- Specified by:
getPlansUsingRepositoryin interfacePlanRepositoryLinkDao- Returns:
- list of
Planthat reference a Source Repository
-
getIdentifiersOfPlansUsingRepository
Description copied from interface:PlanRepositoryLinkDaoGet identifiers of Plans referencing a repository. This is faster than getPlansUsingRepository() and should be preferred for 'view' actions.- Specified by:
getIdentifiersOfPlansUsingRepositoryin interfacePlanRepositoryLinkDao- Returns:
-
getIdentifiersOfPlansUsingRepositoryOrItsDirectChildren
public List<PlanIdentifier> getIdentifiersOfPlansUsingRepositoryOrItsDirectChildren(long repositoryId) Description copied from interface:PlanRepositoryLinkDaoGet identifiers of Plans referencing a repository, either directly or through inheritance (only direct parent-child relationship is checked)- Specified by:
getIdentifiersOfPlansUsingRepositoryOrItsDirectChildrenin interfacePlanRepositoryLinkDao- Returns:
-
isRepositoryOrItsDirectChildrenUsedInPlans
public boolean isRepositoryOrItsDirectChildrenUsedInPlans(long repositoryId) Description copied from interface:PlanRepositoryLinkDaoCheck if repository is used in plans- Specified by:
isRepositoryOrItsDirectChildrenUsedInPlansin interfacePlanRepositoryLinkDao- Returns:
- true if the given repository is used in any plan
-
getPlanRepositoryLink
public PlanRepositoryLink getPlanRepositoryLink(@NotNull @NotNull PlanIdentifier plan, long repositoryId) - Specified by:
getPlanRepositoryLinkin interfacePlanRepositoryLinkDao- Returns:
- relationship between plan and repository if it exists, null otherwise
-
getPlanRepositoryLinkByName
public PlanRepositoryLink getPlanRepositoryLinkByName(@NotNull @NotNull PlanIdentifier plan, @NotNull @NotNull String repositoryName) - Specified by:
getPlanRepositoryLinkByNamein interfacePlanRepositoryLinkDao- Returns:
- relationship between plan and repository if it exists, null otherwise
-
detachAllRepositoriesFromPlan
Description copied from interface:PlanRepositoryLinkDaoRemove allPlanRepositoryLinkdefined for the . Does not deleteRepositoryDataEntityobjects.- Specified by:
detachAllRepositoriesFromPlanin interfacePlanRepositoryLinkDao
-
removeLinksByParentRepositoryId
public void removeLinksByParentRepositoryId(long parentId) Description copied from interface:PlanRepositoryLinkDaoRemoves all link objects where repository is direct child of a repository with given id.- Specified by:
removeLinksByParentRepositoryIdin interfacePlanRepositoryLinkDao
-
removeRepositoryFromPlan
Description copied from interface:PlanRepositoryLinkDaoRemove singlePlanRepositoryLink. Does not deleteRepositoryDataEntity- Specified by:
removeRepositoryFromPlanin interfacePlanRepositoryLinkDao
-
findAllDtos
Description copied from interface:PlanRepositoryLinkDaoFind all in DTO form- Specified by:
findAllDtosin interfacePlanRepositoryLinkDao
-