public class HibernateSpaceDao extends ConfluenceHibernateObjectDao implements SpaceDao
HibernateObjectDao.Cacheability
Modifier and Type | Field and Description |
---|---|
static String |
CACHE_KEY |
cacheFactory, confluenceUserDao
NON_CACHEABLE
Constructor and Description |
---|
HibernateSpaceDao() |
Modifier and Type | Method and Description |
---|---|
int |
countPermittedSpacesForUser(com.atlassian.user.User user,
List<com.atlassian.user.Group> groups,
String permission)
Deprecated.
|
int |
countSpaces(SpacesQuery query)
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.
|
protected com.atlassian.core.bean.EntityObject |
getByClassId(long l)
Retrieve the object with a particular id from the database.
|
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() |
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(SpacesQuery query)
Get a list of spaces specified by the
SpacesQuery . |
List<Space> |
getSpaces(SpacesQuery query,
int offset,
int maxResults)
Get a list of spaces specified by the
SpacesQuery . |
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 |
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 |
setUserAccessor(UserAccessor userAccessor) |
findAllSorted, findLatestVersionsCount, findLatestVersionsCount, findLatestVersionsIterator, findLatestVersionsIterator, findNamedQueryStringParams, findNamedQueryStringParams, save, setCacheFactory, setConfluenceUserDao, updateModificationData
findAll, findAllSorted, findByClassIds, 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, getCountResult, index, refresh, reIndex, replicate, save, saveRaw, setIndexer, unIndex, uniqueResult
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findAll, findAllSorted, findAllSorted, findByClassIds, refresh, replicate, save, saveRaw
public static final String CACHE_KEY
protected com.atlassian.core.bean.EntityObject getByClassId(long l)
HibernateObjectDao
getByClassId
in class HibernateObjectDao
l
- the id of the object to look uppublic Space getSpace(String spaceKey)
public Space getPersonalSpace(ConfluenceUser user)
getPersonalSpace
in interface SpaceDao
user
- the user who's personal space is to be retrievedpublic List<Space> getSpacesCreatedByUser(String username)
SpaceDao
getSpacesCreatedByUser
in interface SpaceDao
public List<Space> getSpacesContainingPagesEditedByUser(String username)
SpaceDao
getSpacesContainingPagesEditedByUser
in interface SpaceDao
username
- the name of the user to track downpublic List<Space> getSpacesContainingCommentsByUser(String username)
SpaceDao
getSpacesContainingCommentsByUser
in interface SpaceDao
username
- the name of the user to track downpublic 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 class HibernateObjectDao
entity
- the object to removepublic Class<Space> getPersistentClass()
getPersistentClass
in interface ObjectDao
public int getNumberOfBlogPosts(Space space)
SpaceDao
getNumberOfBlogPosts
in interface SpaceDao
public int getNumberOfMail(Space space)
SpaceDao
getNumberOfMail
in interface SpaceDao
public List<Space> getSpacesCreatedAfter(Date creationDate)
getSpacesCreatedAfter
in interface SpaceDao
@Deprecated public int countPermittedSpacesForUser(com.atlassian.user.User user, List<com.atlassian.user.Group> groups, String permission)
countPermittedSpacesForUser
in interface SpaceDao
public List<Space> getSpaces(SpacesQuery query, int offset, int maxResults)
SpaceDao
SpacesQuery
.public List<Space> getSpaces(SpacesQuery query)
SpaceDao
SpacesQuery
. Its recommended to use the
SpaceDao.getSpaces(com.atlassian.confluence.spaces.SpacesQuery, int, int)
form of this method where ever
possible.public int countSpaces(SpacesQuery query)
SpaceDao
SpacesQuery
.countSpaces
in interface SpaceDao
public Space getSpaceByContentId(long contentId)
SpaceDao
getSpaceByContentId
in interface SpaceDao
contentId
- the ID of the contentpublic Collection<String> findSpaceKeysWithStatus(String status)
SpaceDao
findSpaceKeysWithStatus
in interface SpaceDao
status
- the status to search forpublic String findUniqueVersionOfSpaceKey(String spaceKey)
SpaceDao
findUniqueVersionOfSpaceKey
in interface SpaceDao
spaceKey
- the space key to create a unique version ofpublic void setUserAccessor(UserAccessor userAccessor)
Copyright © 2003–2015 Atlassian. All rights reserved.