public class RepositoryDefinitionHibernateDao extends BambooHibernateObjectWithOidDao<RepositoryDataEntity> implements RepositoryDefinitionDao
Constructor and Description |
---|
RepositoryDefinitionHibernateDao(TransactionAndHibernateTemplate bambooTransactionHibernateTemplate) |
Modifier and Type | Method and Description |
---|---|
long |
countAll() |
long |
countAllByParent(@Nullable Long parentId) |
@NotNull Long |
countAllProjectsRepositories()
Count project, non-deleted repositories.
|
long |
countRepositoriesByPluginKey(@NotNull String pluginKey) |
long |
countTopLevelGlobalRepositories()
Count global, non-deleted repositories without any parent repository.
|
void |
delete(@NotNull RepositoryDataEntity repositoryDataEntity)
Removes the given entity from the database
|
@NotNull Collection<? extends RepositoryDataEntity> |
findAll() |
@NotNull List<RepositoryDataEntity> |
findAll(boolean includeMarkedForDeletion) |
@NotNull Collection<? extends RepositoryDataEntity> |
findAll(int firstResult,
int maxResults) |
@NotNull Collection<? extends RepositoryDataEntity> |
findAllByParent(@Nullable Long parentId,
int firstResult,
int maxResults) |
@NotNull List<Long> |
findAllProjectsIdsUsingProjectRepositories()
Get IDs of all projects which are using project repositories.
|
@NotNull Set<Long> |
findAllRepositoryIds() |
@NotNull Set<Long> |
findAllRepositoryIds(boolean includeMarkedForDeletion) |
@NotNull Set<Long> |
findAllTopLevelRepositoriesIds()
Get ids of all repositories that doesn't have parent repository (are either linked or are created on plan level)
|
@Nullable RepositoryDataEntityImpl |
findById(long id) |
@Nullable RepositoryDataEntity |
findLinkedRepositoryByName(@NotNull String name)
Find a linked repository by name;
|
@Nullable RepositoryDataEntity |
findProjectRepositoryByName(@NotNull String name,
@NotNull Long projectId)
Find a project repository by name in project associated with given projectId.
|
@NotNull List<RepositoryDataEntity> |
findRepositoriesByPluginKey(@NotNull String pluginKey) |
@NotNull List<RepositoryDataEntity> |
findRepositoriesByPluginKey(@NotNull String pluginKey,
int firstResult,
int maxResults) |
@NotNull List<RepositoryDataEntity> |
getGlobalRepositoryDefinitions() |
@Nullable BambooEntityOid |
getMaxRepositoryOid(int serverKey)
Returns the max
BambooEntityOid that's currently in use of BambooEntityType.REPOSITORY type, with
the given server key. |
@NotNull Collection<RepositoryDataEntity> |
getPrivateRepositoryDefinitionsByPlan(Plan plan) |
@NotNull List<RepositoryDataEntity> |
getProjectRepositoryDefinitions(Long projectId)
Get all project repositories associated with given projectId.
|
@NotNull List<RepositoryDataEntity> |
getTopLevelGlobalRepositories(int firstResult,
int maxResults)
Return a list of global, non-deleted repositories without any parent repository.
|
void |
markForDeletionByParentId(long parentId)
Mark all direct children of repository with given id for deletion.
|
void |
markForDeletionByProjectId(long projectId)
Mark all project repositories with given projectId for deletion.
|
void |
removeRepositoryIfUnused(RepositoryDataEntity repositoryDataEntity) |
void |
removeUnusedRepositories() |
void |
save(@NotNull RepositoryDataEntity repositoryDataEntity)
Saves the given entity.
|
findByOid
countAll, countWithRestriction, deleteAll, executeCountQuery, findAll, findById, merge, saveAll
getCacheAwareHibernateTemplate
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findByOid
countAll, countWithRestriction, deleteAll, findAll, findById, merge, saveAll
public RepositoryDefinitionHibernateDao(TransactionAndHibernateTemplate bambooTransactionHibernateTemplate)
@Nullable public @Nullable RepositoryDataEntityImpl findById(long id)
findById
in interface RepositoryDefinitionDao
@NotNull public @NotNull Collection<? extends RepositoryDataEntity> findAll()
findAll
in interface RepositoryDefinitionDao
@NotNull public @NotNull Collection<? extends RepositoryDataEntity> findAll(int firstResult, int maxResults)
findAll
in interface RepositoryDefinitionDao
@NotNull public @NotNull Collection<? extends RepositoryDataEntity> findAllByParent(@Nullable @Nullable Long parentId, int firstResult, int maxResults)
findAllByParent
in interface RepositoryDefinitionDao
public long countAll()
countAll
in interface RepositoryDefinitionDao
public long countAllByParent(@Nullable @Nullable Long parentId)
countAllByParent
in interface RepositoryDefinitionDao
public long countTopLevelGlobalRepositories()
RepositoryDefinitionDao
countTopLevelGlobalRepositories
in interface RepositoryDefinitionDao
@NotNull public @NotNull List<RepositoryDataEntity> getTopLevelGlobalRepositories(int firstResult, int maxResults)
RepositoryDefinitionDao
getTopLevelGlobalRepositories
in interface RepositoryDefinitionDao
public long countRepositoriesByPluginKey(@NotNull @NotNull String pluginKey)
@NotNull public @NotNull List<RepositoryDataEntity> findRepositoriesByPluginKey(@NotNull @NotNull String pluginKey)
findRepositoriesByPluginKey
in interface RepositoryDefinitionDao
@NotNull public @NotNull List<RepositoryDataEntity> findRepositoriesByPluginKey(@NotNull @NotNull String pluginKey, int firstResult, int maxResults)
@NotNull public @NotNull List<RepositoryDataEntity> getGlobalRepositoryDefinitions()
getGlobalRepositoryDefinitions
in interface RepositoryDefinitionDao
@NotNull public @NotNull List<RepositoryDataEntity> getProjectRepositoryDefinitions(Long projectId)
RepositoryDefinitionDao
getProjectRepositoryDefinitions
in interface RepositoryDefinitionDao
@NotNull public @NotNull Long countAllProjectsRepositories()
RepositoryDefinitionDao
countAllProjectsRepositories
in interface RepositoryDefinitionDao
@NotNull public @NotNull List<Long> findAllProjectsIdsUsingProjectRepositories()
RepositoryDefinitionDao
findAllProjectsIdsUsingProjectRepositories
in interface RepositoryDefinitionDao
@NotNull public @NotNull Collection<RepositoryDataEntity> getPrivateRepositoryDefinitionsByPlan(Plan plan)
getPrivateRepositoryDefinitionsByPlan
in interface RepositoryDefinitionDao
public void removeRepositoryIfUnused(RepositoryDataEntity repositoryDataEntity)
removeRepositoryIfUnused
in interface RepositoryDefinitionDao
public void delete(@NotNull @NotNull RepositoryDataEntity repositoryDataEntity)
BambooObjectDao
delete
in interface BambooObjectDao<RepositoryDataEntity>
delete
in class BambooHibernateObjectDao<RepositoryDataEntity>
repositoryDataEntity
- entity to be removedpublic void save(@NotNull @NotNull RepositoryDataEntity repositoryDataEntity)
BambooObjectDao
EntityObject
this method will:
- update EntityObject.getLastModificationDate()
- set EntityObject.getCreationDate()
if the object has not been savedsave
in interface BambooObjectDao<RepositoryDataEntity>
save
in class BambooHibernateObjectDao<RepositoryDataEntity>
repositoryDataEntity
- entity to be savedpublic void removeUnusedRepositories()
removeUnusedRepositories
in interface RepositoryDefinitionDao
@NotNull public @NotNull Set<Long> findAllRepositoryIds()
findAllRepositoryIds
in interface RepositoryDefinitionDao
@NotNull public @NotNull Set<Long> findAllRepositoryIds(boolean includeMarkedForDeletion)
findAllRepositoryIds
in interface RepositoryDefinitionDao
@NotNull public @NotNull List<RepositoryDataEntity> findAll(boolean includeMarkedForDeletion)
findAll
in interface RepositoryDefinitionDao
@NotNull public @NotNull Set<Long> findAllTopLevelRepositoriesIds()
RepositoryDefinitionDao
findAllTopLevelRepositoriesIds
in interface RepositoryDefinitionDao
@Nullable public @Nullable BambooEntityOid getMaxRepositoryOid(int serverKey)
RepositoryDefinitionDao
BambooEntityOid
that's currently in use of BambooEntityType.REPOSITORY
type, with
the given server key.
Returns null if no OIDs are in use of this type with the given server key.getMaxRepositoryOid
in interface RepositoryDefinitionDao
@Nullable public @Nullable RepositoryDataEntity findLinkedRepositoryByName(@NotNull @NotNull String name)
RepositoryDefinitionDao
findLinkedRepositoryByName
in interface RepositoryDefinitionDao
public void markForDeletionByParentId(long parentId)
RepositoryDefinitionDao
markForDeletionByParentId
in interface RepositoryDefinitionDao
public void markForDeletionByProjectId(long projectId)
RepositoryDefinitionDao
markForDeletionByProjectId
in interface RepositoryDefinitionDao
@Nullable public @Nullable RepositoryDataEntity findProjectRepositoryByName(@NotNull @NotNull String name, @NotNull @NotNull Long projectId)
RepositoryDefinitionDao
findProjectRepositoryByName
in interface RepositoryDefinitionDao
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.