@ParametersAreNonnullByDefault public class HibernateSpaceDao extends ConfluenceHibernateObjectDao<Space> implements SpaceDaoInternal
HibernateObjectDao.Cacheability| Modifier and Type | Field and Description |
|---|---|
static String |
CACHE_KEY
Deprecated.
since 5.10
|
cacheFactory, confluenceUserDao| Constructor and Description |
|---|
HibernateSpaceDao() |
| Modifier and Type | Method and Description |
|---|---|
int |
countSpaces(SpacesQueryWithPermissionQueryBuilder queryWithPermissionClauseBuilder)
Count the spaces specified by the
SpacesQuery. |
List<String> |
findAllSpaceKeys()
Retrieves a list of space keys.
|
int |
findPageTotal(Space space)
Fast way to count pages in a space without loading them.
|
List<Long> |
findSpaceIdListWithIdGreaterOrEqual(Long startingId,
int limit)
Retrieves a limited space list starting with a particular space id.
|
@NonNull Collection<String> |
findSpaceKeysWithStatus(String status)
find all space keys where the space status is equal to the given status.
|
@NonNull String |
findUniqueVersionOfSpaceKey(String spaceKey)
Return a unique version of the supplied spaceKey.
|
@Nullable Space |
getById(long id) |
int |
getNumberOfBlogPosts(Space space)
Fast way to count blog posts in a space without loading them.
|
@NonNull Class<Space> |
getPersistentClass()
Gets the type of
EntityObject this Dao works with. |
@Nullable Space |
getPersonalSpace(@Nullable ConfluenceUser user) |
@Nullable Space |
getSpace(@Nullable String spaceKey)
first tries to fetch the space from the cache by space id
if not, fetch it from database
|
@Nullable Space |
getSpaceByContentId(long contentId)
Get the space that some content belongs to in a single db query.
|
@NonNull List<Space> |
getSpaces(SpacesQueryWithPermissionQueryBuilder queryWithPermissionClauseBuilder)
Get a list of spaces specified by the
SpacesQuery. |
@NonNull List<Space> |
getSpaces(SpacesQueryWithPermissionQueryBuilder queryWithPermissionClauseBuilder,
int offset,
int maxResults)
Get a list of spaces specified by the
SpacesQueryWithPermissionQueryBuilder. |
@NonNull List<Space> |
getSpacesContainingCommentsByUser(@Nullable String username)
Find all spaces containing comments by a particular user.
|
@NonNull List<Space> |
getSpacesContainingPagesEditedByUser(@Nullable String username)
Find all spaces containing pages that were edited by a particular user.
|
@NonNull List<Space> |
getSpacesCreatedAfter(Date creationDate) |
@NonNull List<Space> |
getSpacesCreatedByUser(@Nullable String username)
Find all the spaces created by a given user.
|
@NonNull List<Space> |
getSpacesCreatedOrUpdatedSinceDate(Date previousLoginDate) |
void |
performOnAll(Consumer<Space> task)
Perform the task with all spaces.
|
void |
remove(com.atlassian.core.bean.EntityObject entity)
Override the parent remove method as we want to remove the object out of the cache as well
|
findAllSorted, findLatestVersionsCount, findLatestVersionsCount, findLatestVersionsIterator, findLatestVersionsIterator, findNamedQueryStringParams, findNamedQueryStringParams, save, saveEntity, setCacheFactory, setConfluenceUserDao, updateEntityModificationData, updateModificationDataapplyTransactionTimeout, applyTransactionTimeout, checkDaoConfig, createHibernateTemplate, findAll, findAllSorted, findByClassIds, findByClassIdsFiltered, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getByClassId, getCountResult, getHibernateTemplate, getSession, getSessionFactory, index, indexEntity, refresh, refreshEntity, reIndex, reIndexEntity, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity, setEventPublisher, setHibernateTemplate, setIndexer, setSessionFactory, unIndex, unIndexEntity, uniqueResultclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfindAll, findAllSorted, findAllSorted, findByClassIds, findByClassIdsFiltered, refresh, refreshEntity, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity@Deprecated public static final String CACHE_KEY
public @Nullable Space getSpace(@Nullable String spaceKey)
public @Nullable Space getPersonalSpace(@Nullable ConfluenceUser user)
getPersonalSpace in interface SpaceDaouser - the user who's personal space is to be retrievedpublic @NonNull List<Space> getSpacesCreatedByUser(@Nullable String username)
SpaceDaogetSpacesCreatedByUser in interface SpaceDaopublic @NonNull List<Space> getSpacesContainingPagesEditedByUser(@Nullable String username)
SpaceDaogetSpacesContainingPagesEditedByUser in interface SpaceDaousername - the name of the user to track downpublic @NonNull List<Space> getSpacesContainingCommentsByUser(@Nullable String username)
SpaceDaoDoes currently not include personal spaces, but probably should.
getSpacesContainingCommentsByUser in interface SpaceDaousername - the name of the user to track downpublic @NonNull List<Space> getSpacesCreatedOrUpdatedSinceDate(Date previousLoginDate)
getSpacesCreatedOrUpdatedSinceDate in interface SpaceDaopublic int findPageTotal(Space space)
SpaceDaofindPageTotal in interface SpaceDaopublic void remove(com.atlassian.core.bean.EntityObject entity)
remove in interface ObjectDaoremove in interface ObjectDaoInternal<Space>remove in class HibernateObjectDao<Space>entity - the object to removepublic @NonNull Class<Space> getPersistentClass()
ObjectDaoInternalEntityObject this Dao works with.getPersistentClass in interface ObjectDaogetPersistentClass in interface ObjectDaoInternal<Space>public int getNumberOfBlogPosts(Space space)
SpaceDaogetNumberOfBlogPosts in interface SpaceDaopublic @NonNull List<Space> getSpacesCreatedAfter(Date creationDate)
getSpacesCreatedAfter in interface SpaceDaopublic @NonNull List<Space> getSpaces(SpacesQueryWithPermissionQueryBuilder queryWithPermissionClauseBuilder, int offset, int maxResults)
SpaceDaoSpacesQueryWithPermissionQueryBuilder.public @NonNull List<Space> getSpaces(SpacesQueryWithPermissionQueryBuilder queryWithPermissionClauseBuilder)
SpaceDaoSpacesQuery. Its recommended to use the
SpaceDao.getSpaces(SpacesQueryWithPermissionQueryBuilder, int, int) form of this method where ever possible.public int countSpaces(SpacesQueryWithPermissionQueryBuilder queryWithPermissionClauseBuilder)
SpaceDaoSpacesQuery.countSpaces in interface SpaceDaopublic @Nullable Space getSpaceByContentId(long contentId)
SpaceDaogetSpaceByContentId in interface SpaceDaocontentId - the ID of the contentpublic @NonNull Collection<String> findSpaceKeysWithStatus(String status)
SpaceDaofindSpaceKeysWithStatus in interface SpaceDaostatus - the status to search forpublic @NonNull String findUniqueVersionOfSpaceKey(String spaceKey)
SpaceDaofindUniqueVersionOfSpaceKey in interface SpaceDaospaceKey - the space key to create a unique version ofpublic void performOnAll(Consumer<Space> task)
SpaceDaoperformOnAll in interface SpaceDaotask - apply to spaces.public List<Long> findSpaceIdListWithIdGreaterOrEqual(Long startingId, int limit)
findSpaceIdListWithIdGreaterOrEqual in interface SpaceDaoInternalstartingId - - space idlimit - - limitpublic List<String> findAllSpaceKeys()
findAllSpaceKeys in interface SpaceDaoInternalCopyright © 2003–2022 Atlassian. All rights reserved.