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<PlanRepositoryLink>
-
- com.atlassian.bamboo.repository.PlanRepositoryLinkHibernateDao
-
- All Implemented Interfaces:
BambooObjectDao<PlanRepositoryLink>,PlanRepositoryLinkDao,org.springframework.beans.factory.InitializingBean
public class PlanRepositoryLinkHibernateDao extends BambooHibernateObjectDao<PlanRepositoryLink> implements PlanRepositoryLinkDao
-
-
Constructor Summary
Constructors Constructor Description PlanRepositoryLinkHibernateDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddetachAllRepositoriesFromPlan(@NotNull ImmutablePlan plan)Remove allPlanRepositoryLinkdefined for the .@NotNull List<PlanRepositoryLinkDto>findAllDtos()Find all in DTO formList<PlanIdentifier>getIdentifiersOfPlansUsingRepository(long repositoryId)Get identifiers of Plans referencing a repository.List<PlanIdentifier>getIdentifiersOfPlansUsingRepositoryOrItsDirectChildren(long repositoryId)Get identifiers of Plans referencing a repository, either directly or through inheritance (only direct parent-child relationship is checked)PlanRepositoryLinkgetPlanRepositoryLink(@NotNull PlanIdentifier plan, long repositoryId)PlanRepositoryLinkgetPlanRepositoryLinkByName(@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)List<PlanRepositoryLink>getPlansUsingRepository(long repositoryId)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.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
-
-
-
-
Method Detail
-
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()
-
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
public List<PlanRepositoryLink> getPlansUsingRepository(long repositoryId)
- Specified by:
getPlansUsingRepositoryin interfacePlanRepositoryLinkDao- Returns:
- list of
Planthat reference a Source Repository
-
getIdentifiersOfPlansUsingRepository
public List<PlanIdentifier> getIdentifiersOfPlansUsingRepository(long repositoryId)
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
public void detachAllRepositoriesFromPlan(@NotNull @NotNull ImmutablePlan plan)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
public void removeRepositoryFromPlan(@NotNull @NotNull PlanRepositoryLink planRepository)Description copied from interface:PlanRepositoryLinkDaoRemove singlePlanRepositoryLink. Does not deleteRepositoryDataEntity- Specified by:
removeRepositoryFromPlanin interfacePlanRepositoryLinkDao
-
findAllDtos
@NotNull public @NotNull List<PlanRepositoryLinkDto> findAllDtos()
Description copied from interface:PlanRepositoryLinkDaoFind all in DTO form- Specified by:
findAllDtosin interfacePlanRepositoryLinkDao
-
-