public class ContentEntityObjectHibernateDao extends VersionedHibernateObjectDao implements ContentEntityObjectDao
HibernateObjectDao.Cacheability
Modifier and Type | Field and Description |
---|---|
static long |
ONE_DAY |
cacheFactory, confluenceUserDao
NON_CACHEABLE
Constructor and Description |
---|
ContentEntityObjectHibernateDao() |
Modifier and Type | Method and Description |
---|---|
int |
countContentBySpaceIdAndStatus(long spaceId,
String status)
Retrieve the count of content for a given space with a particular status.
|
List<ContentEntityObject> |
findContentBySpaceIdAndStatus(long spaceId,
String status,
int offset,
int count)
Retrieve content for a given space with a particular status.
|
PageResponse<ContentEntityObject> |
findContentBySpaceIdAndStatus(long spaceId,
String status,
LimitedRequest limitedRequest,
com.google.common.base.Predicate<Page> predicate)
Retrieve content for a given space with a particular status.
|
ContentEntityObject |
findDraftFor(long contentId)
Retrieves the draft for the given content if exists.
|
List |
findHistoricalVersionsAfterVersion(long originalContentId,
int version) |
List |
findPreviousVersions(long originalContentId) |
List<ContentEntityObject> |
findUnpublishedContentWithUserContributions(String username)
Retrives the drafts for the given
User |
Iterator |
getAllCurrentEntities() |
protected ContentEntityObject |
getByClassId(long id)
Retrieve the object with a particular id from the database.
|
ContentEntityObject |
getById(long id) |
List |
getContentAuthoredByUser(String username) |
ContentEntityObject |
getFirstVersionAfter(long originalVersionContentId,
int version) |
ContentEntityObject |
getFirstVersionBefore(long originalVersionContentId,
int version) |
List<ContentEntityObject> |
getLastEditedVersionsOf(ContentEntityObject content)
Retrieves all the last edited versions for each user who has contributed to the specified piece of content.
|
List |
getLockedContentBySpace(String spaceKey)
Deprecated.
since 2.10. There is no replacement as this functionality was superseded by
multiple page permissions (CONF-3701)
|
String |
getObjectType(long id) |
Date |
getOldestPageCreationDate()
Gets the creation date of the oldest page.
|
PageResponse<AbstractPage> |
getPageAndBlogPostsVersionsLastEditedByUser(com.atlassian.sal.api.user.UserKey userKey,
LimitedRequest limitedRequest)
Retrieve a page of entities, either the current version or historical version, that have been modified by the user,
in order of the user's most recent modification.
|
Class |
getPersistentClass() |
Iterator |
getRecentlyAddedEntities(String spaceKey,
int maxResults) |
Iterator |
getRecentlyModifiedEntities(int maxResults) |
Iterator |
getRecentlyModifiedEntities(String spaceKey,
int maxResults) |
Iterator |
getRecentlyModifiedEntitiesForUser(String username) |
List |
getRecentlyModifiedForChangeDigest(Date fromDate)
Retrieves a list of
ContentEntityObject s that have been newly added or modified
since the date specified. |
List |
getTrashedContent(String spaceKey) |
ContentEntityObject |
getVersion(long originalVersionContentId,
int version) |
List<VersionHistorySummary> |
getVersionHistorySummary(long originalContentId) |
Map<Long,ContentEntityObject> |
getVersionsLastEditedByUser(Collection<Long> contentIds,
com.atlassian.sal.api.user.UserKey userKey)
Gets the
ContentEntityObject objects, either the current version or historical version relating to
given contentIds of the current version that was the most recent version edited by the given user. |
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, remove, 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
findLatestVersionsCount, findLatestVersionsIterator, save
findAll, findAllSorted, findAllSorted, findByClassIds, refresh, remove, replicate, save, saveRaw
public static final long ONE_DAY
public Class getPersistentClass()
getPersistentClass
in interface ObjectDao
public ContentEntityObject getById(long id)
getById
in interface ContentEntityObjectDao
protected ContentEntityObject getByClassId(long id)
HibernateObjectDao
getByClassId
in class HibernateObjectDao
id
- the id of the object to look uppublic List getContentAuthoredByUser(String username)
getContentAuthoredByUser
in interface ContentEntityObjectDao
public Iterator getAllCurrentEntities()
getAllCurrentEntities
in interface ContentEntityObjectDao
public Iterator getRecentlyAddedEntities(String spaceKey, int maxResults)
getRecentlyAddedEntities
in interface ContentEntityObjectDao
public Iterator getRecentlyModifiedEntities(int maxResults)
getRecentlyModifiedEntities
in interface ContentEntityObjectDao
public Iterator getRecentlyModifiedEntities(String spaceKey, int maxResults)
getRecentlyModifiedEntities
in interface ContentEntityObjectDao
public Iterator getRecentlyModifiedEntitiesForUser(String username)
getRecentlyModifiedEntitiesForUser
in interface ContentEntityObjectDao
public ContentEntityObject getFirstVersionBefore(long originalVersionContentId, int version)
getFirstVersionBefore
in interface ContentEntityObjectDao
public ContentEntityObject getFirstVersionAfter(long originalVersionContentId, int version)
getFirstVersionAfter
in interface ContentEntityObjectDao
public ContentEntityObject getVersion(long originalVersionContentId, int version)
getVersion
in interface ContentEntityObjectDao
public List getRecentlyModifiedForChangeDigest(Date fromDate)
ContentEntityObjectDao
ContentEntityObject
s that have been newly added or modified
since the date specified. This list excludes drafts, space descriptions and mail.getRecentlyModifiedForChangeDigest
in interface ContentEntityObjectDao
fromDate
- content modified after this date will be returnedContentEntityObject
s that have been newly added or modified
since the date specifiedpublic List<ContentEntityObject> getLastEditedVersionsOf(ContentEntityObject content)
ContentEntityObjectDao
getLastEditedVersionsOf
in interface ContentEntityObjectDao
content
- latest version@Deprecated public List getLockedContentBySpace(String spaceKey)
getLockedContentBySpace
in interface ContentEntityObjectDao
public List getTrashedContent(String spaceKey)
getTrashedContent
in interface ContentEntityObjectDao
public List<ContentEntityObject> findContentBySpaceIdAndStatus(long spaceId, String status, int offset, int count)
ContentEntityObjectDao
findContentBySpaceIdAndStatus
in interface ContentEntityObjectDao
spaceId
- the id of the spacestatus
- the status of the content being retrieved (e.g. ContentEntityObject.DELETED
offset
- the offset of the first item to retrieve (0-based)count
- the maximum number of items to retrievepublic PageResponse<ContentEntityObject> findContentBySpaceIdAndStatus(long spaceId, String status, LimitedRequest limitedRequest, com.google.common.base.Predicate<Page> predicate)
ContentEntityObjectDao
findContentBySpaceIdAndStatus
in interface ContentEntityObjectDao
spaceId
- the id of the spacestatus
- the status of the content being retrieved (e.g. ContentEntityObject.DELETED
limitedRequest
- - the start and offset of the pages to retrievepredicate
- - a predicate to filter the returned results bypublic int countContentBySpaceIdAndStatus(long spaceId, String status)
ContentEntityObjectDao
countContentBySpaceIdAndStatus
in interface ContentEntityObjectDao
spaceId
- the id of the spacestatus
- the status of the content being retrieved (e.g. ContentEntityObject.DELETED
public String getObjectType(long id)
getObjectType
in interface ContentEntityObjectDao
public Map<Long,ContentEntityObject> getVersionsLastEditedByUser(Collection<Long> contentIds, com.atlassian.sal.api.user.UserKey userKey)
ContentEntityObjectDao
ContentEntityObject
objects, either the current version or historical version relating to
given contentIds of the current version that was the most recent version edited by the given user. Only content
with a "current" status are returned.getVersionsLastEditedByUser
in interface ContentEntityObjectDao
contentIds
- the ids of the content we're interested in. These *must* be ids of the latest version.userKey
- the userKey of the user that we're interested inContentEntityObject
objects relating to the version of the given contentIds that were last
edited by the given user.public PageResponse<AbstractPage> getPageAndBlogPostsVersionsLastEditedByUser(com.atlassian.sal.api.user.UserKey userKey, LimitedRequest limitedRequest)
ContentEntityObjectDao
getPageAndBlogPostsVersionsLastEditedByUser
in interface ContentEntityObjectDao
userKey
- the key for the user for whom to retrieve the modified contentlimitedRequest
- the requestpublic List<VersionHistorySummary> getVersionHistorySummary(long originalContentId)
getVersionHistorySummary
in interface ContentEntityObjectDao
public List findPreviousVersions(long originalContentId)
findPreviousVersions
in interface ContentEntityObjectDao
public List findHistoricalVersionsAfterVersion(long originalContentId, int version)
findHistoricalVersionsAfterVersion
in interface ContentEntityObjectDao
public Date getOldestPageCreationDate()
ContentEntityObjectDao
getOldestPageCreationDate
in interface ContentEntityObjectDao
public ContentEntityObject findDraftFor(long contentId)
ContentEntityObjectDao
findDraftFor
in interface ContentEntityObjectDao
contentId
- id of the content to retrieve the draft forContentEntityObject.DRAFT
public List<ContentEntityObject> findUnpublishedContentWithUserContributions(String username)
ContentEntityObjectDao
User
findUnpublishedContentWithUserContributions
in interface ContentEntityObjectDao
username
- the owner of the draftsContentEntityObject
with the
ContentEntityObject.DRAFT
statusCopyright © 2003–2016 Atlassian. All rights reserved.