@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
NON_CACHEABLE
Constructor and Description |
---|
HibernateSpaceDao() |
Modifier and Type | Method and Description |
---|---|
int |
countSpaces(SpacesQueryWithPermissionQueryBuilder queryWithPermissionClauseBuilder)
Count the spaces specified by the
SpacesQuery . |
int |
findPageTotal(Space space)
Fast way to count pages in a space without loading them.
|
Collection<String> |
findSpaceKeysWithStatus(String status)
find all space keys where the space status is equal to the given status.
|
String |
findUniqueVersionOfSpaceKey(String spaceKey)
Return a unique version of the supplied spaceKey.
|
Space |
getById(long id) |
int |
getNumberOfBlogPosts(Space space)
Fast way to count blog posts in a space without loading them.
|
int |
getNumberOfMail(Space space)
Fast way to count pages in a space without loading them.
|
Class<Space> |
getPersistentClass()
Gets the type of
EntityObject this Dao works with. |
Space |
getPersonalSpace(ConfluenceUser user) |
Space |
getSpace(String spaceKey)
first tries to fetch the space from the cache by space id
if not, fetch it from database
|
Space |
getSpaceByContentId(long contentId)
Get the space that some content belongs to in a single db query.
|
List<Space> |
getSpaces(SpacesQueryWithPermissionQueryBuilder queryWithPermissionClauseBuilder)
Get a list of spaces specified by the
SpacesQuery . |
List<Space> |
getSpaces(SpacesQueryWithPermissionQueryBuilder queryWithPermissionClauseBuilder,
int offset,
int maxResults)
Get a list of spaces specified by the
SpacesQueryWithPermissionQueryBuilder . |
List<Space> |
getSpacesContainingCommentsByUser(String username)
Find all spaces containing comments by a particular user.
|
List<Space> |
getSpacesContainingPagesEditedByUser(String username)
Find all spaces containing pages that were edited by a particular user.
|
List<Space> |
getSpacesCreatedAfter(Date creationDate) |
List<Space> |
getSpacesCreatedByUser(String username)
Find all the spaces created by a given user.
|
List<Space> |
getSpacesCreatedOrUpdatedSinceDate(Date previousLoginDate) |
void |
initCache() |
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
|
void |
setVcacheFactory(com.atlassian.vcache.VCacheFactory vcacheFactory) |
findAllSorted, findLatestVersionsCount, findLatestVersionsCount, findLatestVersionsIterator, findLatestVersionsIterator, findNamedQueryStringParams, findNamedQueryStringParams, save, saveEntity, setCacheFactory, setConfluenceUserDao, updateEntityModificationData, updateModificationData
applyTransactionTimeout, applyTransactionTimeout, checkDaoConfig, createHibernateTemplate, findAll, findAllSorted, findByClassIds, findByClassIdsFiltered, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, 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, setHibernateTemplate, setIndexer, setSessionFactory, unIndex, unIndexEntity, uniqueResult
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findAll, findAllSorted, findAllSorted, findByClassIds, findByClassIdsFiltered, refresh, refreshEntity, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity
@Deprecated public static final String CACHE_KEY
@PostConstruct public void initCache()
@Nullable public Space getSpace(@Nullable String spaceKey)
@Nullable public Space getPersonalSpace(@Nullable ConfluenceUser user)
getPersonalSpace
in interface SpaceDao
user
- the user who's personal space is to be retrieved@Nonnull public List<Space> getSpacesCreatedByUser(@Nullable String username)
SpaceDao
getSpacesCreatedByUser
in interface SpaceDao
@Nonnull public List<Space> getSpacesContainingPagesEditedByUser(@Nullable String username)
SpaceDao
getSpacesContainingPagesEditedByUser
in interface SpaceDao
username
- the name of the user to track down@Nonnull public List<Space> getSpacesContainingCommentsByUser(@Nullable String username)
SpaceDao
Does currently not include personal spaces, but probably should.
getSpacesContainingCommentsByUser
in interface SpaceDao
username
- the name of the user to track down@Nonnull public List<Space> getSpacesCreatedOrUpdatedSinceDate(Date previousLoginDate)
getSpacesCreatedOrUpdatedSinceDate
in interface SpaceDao
public int findPageTotal(Space space)
SpaceDao
findPageTotal
in interface SpaceDao
public void remove(com.atlassian.core.bean.EntityObject entity)
remove
in interface ObjectDao
remove
in interface ObjectDaoInternal<Space>
remove
in class HibernateObjectDao<Space>
entity
- the object to remove@Nonnull public Class<Space> getPersistentClass()
ObjectDaoInternal
EntityObject
this Dao works with.getPersistentClass
in interface ObjectDao
getPersistentClass
in interface ObjectDaoInternal<Space>
public int getNumberOfBlogPosts(Space space)
SpaceDao
getNumberOfBlogPosts
in interface SpaceDao
public int getNumberOfMail(Space space)
SpaceDao
getNumberOfMail
in interface SpaceDao
@Nonnull public List<Space> getSpacesCreatedAfter(Date creationDate)
getSpacesCreatedAfter
in interface SpaceDao
@Nonnull public List<Space> getSpaces(SpacesQueryWithPermissionQueryBuilder queryWithPermissionClauseBuilder, int offset, int maxResults)
SpaceDao
SpacesQueryWithPermissionQueryBuilder
.@Nonnull public List<Space> getSpaces(SpacesQueryWithPermissionQueryBuilder queryWithPermissionClauseBuilder)
SpaceDao
SpacesQuery
. Its recommended to use the
SpaceDao.getSpaces(SpacesQueryWithPermissionQueryBuilder, int, int)
form of this method where ever possible.public int countSpaces(SpacesQueryWithPermissionQueryBuilder queryWithPermissionClauseBuilder)
SpaceDao
SpacesQuery
.countSpaces
in interface SpaceDao
@Nullable public Space getSpaceByContentId(long contentId)
SpaceDao
getSpaceByContentId
in interface SpaceDao
contentId
- the ID of the content@Nonnull public Collection<String> findSpaceKeysWithStatus(String status)
SpaceDao
findSpaceKeysWithStatus
in interface SpaceDao
status
- the status to search for@Nonnull public String findUniqueVersionOfSpaceKey(String spaceKey)
SpaceDao
findUniqueVersionOfSpaceKey
in interface SpaceDao
spaceKey
- the space key to create a unique version ofpublic void performOnAll(Consumer<Space> task)
SpaceDao
performOnAll
in interface SpaceDao
task
- apply to spaces.public void setVcacheFactory(com.atlassian.vcache.VCacheFactory vcacheFactory)
Copyright © 2003–2021 Atlassian. All rights reserved.