com.atlassian.confluence.core.persistence.hibernate
Class ContentEntityObjectHibernateDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate.support.HibernateDaoSupport
          extended by com.atlassian.hibernate.HibernateObjectDao
              extended by com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
                  extended by com.atlassian.confluence.core.persistence.hibernate.ContentEntityObjectHibernateDao
All Implemented Interfaces:
ObjectDao, ContentEntityObjectDao, VersionedObjectDao, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
DefaultContentDao, HibernateMailDao, HibernatePageDao, HibernateUserStatusDao, PluginContentHibernateDao

public class ContentEntityObjectHibernateDao
extends VersionedHibernateObjectDao
implements ContentEntityObjectDao


Field Summary
static long ONE_DAY
           
 
Fields inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
cacheFactory, confluenceUserDao
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
ContentEntityObjectHibernateDao()
           
 
Method Summary
 int countContentBySpaceIdAndStatus(long spaceId, java.lang.String status)
          Retrieve the count of content for a given space with a particular status.
 java.util.List<ContentEntityObject> findContentBySpaceIdAndStatus(long spaceId, java.lang.String status, int offset, int count)
          Retrieve content for a given space with a particular status.
 PageResponse<ContentEntityObject> findContentBySpaceIdAndStatus(long spaceId, java.lang.String status, LimitedRequest limitedRequest, com.google.common.base.Predicate<Page> predicate)
          Retrieve content for a given space with a particular status.
 java.util.List findHistoricalVersionsAfterVersion(long originalContentId, int version)
           
 java.util.List findPreviousVersions(long originalContentId)
           
 java.util.Iterator getAllCurrentEntities()
           
protected  ContentEntityObject getByClassId(long id)
          Retrieve the object with a particular id from the database.
 ContentEntityObject getById(long id)
           
 java.util.List getContentAuthoredByUser(java.lang.String username)
           
 ContentEntityObject getFirstVersionAfter(long originalVersionContentId, int version)
           
 ContentEntityObject getFirstVersionBefore(long originalVersionContentId, int version)
           
 java.util.List<ContentEntityObject> getLastEditedVersionsOf(ContentEntityObject content)
          Retrieves all the last edited versions for each user who has contributed to the specified piece of content.
 java.util.List getLockedContentBySpace(java.lang.String spaceKey)
          Deprecated. since 2.10. There is no replacement as this functionality was superseded by multiple page permissions (CONF-3701)
 java.lang.String getObjectType(long id)
           
 java.util.Date getOldestPageCreationDate()
          Gets the creation date of the oldest page.
 java.lang.Class getPersistentClass()
           
 java.util.Iterator getRecentlyAddedEntities(java.lang.String spaceKey, int maxResults)
           
 java.util.Iterator getRecentlyModifiedEntities(int maxResults)
           
 java.util.Iterator getRecentlyModifiedEntities(java.lang.String spaceKey, int maxResults)
           
 java.util.Iterator getRecentlyModifiedEntitiesForUser(java.lang.String username)
           
 java.util.List getRecentlyModifiedForChangeDigest(java.util.Date fromDate)
          Retrieves a list of ContentEntityObjects that have been newly added or modified since the date specified.
 java.util.List getTrashedContent(java.lang.String spaceKey)
           
 ContentEntityObject getVersion(long originalVersionContentId, int version)
           
 java.util.List<VersionHistorySummary> getVersionHistorySummary(long originalContentId)
           
 
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
findAllSorted, findLatestVersionsCount, findLatestVersionsIterator, findNamedQueryStringParams, save, setCacheFactory, setConfluenceUserDao, updateModificationData
 
Methods inherited from class com.atlassian.hibernate.HibernateObjectDao
findAll, findAllSorted, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getCountResult, index, refresh, reIndex, remove, replicate, save, saveRaw, setIndexer, unIndex, uniqueResult
 
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.confluence.core.persistence.VersionedObjectDao
findLatestVersionsCount, findLatestVersionsIterator, save
 
Methods inherited from interface bucket.core.persistence.ObjectDao
findAll, findAllSorted, findAllSorted, refresh, remove, replicate, save, saveRaw
 

Field Detail

ONE_DAY

public static final long ONE_DAY
See Also:
Constant Field Values
Constructor Detail

ContentEntityObjectHibernateDao

public ContentEntityObjectHibernateDao()
Method Detail

getPersistentClass

public java.lang.Class getPersistentClass()
Specified by:
getPersistentClass in interface ObjectDao

getById

public ContentEntityObject getById(long id)
Specified by:
getById in interface ContentEntityObjectDao

getByClassId

protected ContentEntityObject getByClassId(long id)
Description copied from class: HibernateObjectDao
Retrieve the object with a particular id from the database. The object must be of the same class as the DAO's getPersistentClass() method returns.

Overrides:
getByClassId in class HibernateObjectDao
Parameters:
id - the id of the object to look up
Returns:
the corresponding object, or null if the object does not exist with the appropriate class and id.

getContentAuthoredByUser

public java.util.List getContentAuthoredByUser(java.lang.String username)
Specified by:
getContentAuthoredByUser in interface ContentEntityObjectDao

getAllCurrentEntities

public java.util.Iterator getAllCurrentEntities()
Specified by:
getAllCurrentEntities in interface ContentEntityObjectDao

getRecentlyAddedEntities

public java.util.Iterator getRecentlyAddedEntities(java.lang.String spaceKey,
                                                   int maxResults)
Specified by:
getRecentlyAddedEntities in interface ContentEntityObjectDao

getRecentlyModifiedEntities

public java.util.Iterator getRecentlyModifiedEntities(int maxResults)
Specified by:
getRecentlyModifiedEntities in interface ContentEntityObjectDao

getRecentlyModifiedEntities

public java.util.Iterator getRecentlyModifiedEntities(java.lang.String spaceKey,
                                                      int maxResults)
Specified by:
getRecentlyModifiedEntities in interface ContentEntityObjectDao

getRecentlyModifiedEntitiesForUser

public java.util.Iterator getRecentlyModifiedEntitiesForUser(java.lang.String username)
Specified by:
getRecentlyModifiedEntitiesForUser in interface ContentEntityObjectDao

getFirstVersionBefore

public ContentEntityObject getFirstVersionBefore(long originalVersionContentId,
                                                 int version)
Specified by:
getFirstVersionBefore in interface ContentEntityObjectDao

getFirstVersionAfter

public ContentEntityObject getFirstVersionAfter(long originalVersionContentId,
                                                int version)
Specified by:
getFirstVersionAfter in interface ContentEntityObjectDao

getVersion

public ContentEntityObject getVersion(long originalVersionContentId,
                                      int version)
Specified by:
getVersion in interface ContentEntityObjectDao

getRecentlyModifiedForChangeDigest

public java.util.List getRecentlyModifiedForChangeDigest(java.util.Date fromDate)
Description copied from interface: ContentEntityObjectDao
Retrieves a list of ContentEntityObjects that have been newly added or modified since the date specified. This list excludes drafts, space descriptions and mail.

Specified by:
getRecentlyModifiedForChangeDigest in interface ContentEntityObjectDao
Parameters:
fromDate - content modified after this date will be returned
Returns:
a list of ContentEntityObjects that have been newly added or modified since the date specified

getLastEditedVersionsOf

public java.util.List<ContentEntityObject> getLastEditedVersionsOf(ContentEntityObject content)
Description copied from interface: ContentEntityObjectDao
Retrieves all the last edited versions for each user who has contributed to the specified piece of content. That is, if a user has contributed multiple edits, only the version that corresponds to their latest edit will be added to the list returned. Result will be sorted with the earliest version coming first.

Specified by:
getLastEditedVersionsOf in interface ContentEntityObjectDao
Parameters:
content - latest version
Returns:
the last edited versions for each user who has contributed to the specified piece of content.

getLockedContentBySpace

@Deprecated
public java.util.List getLockedContentBySpace(java.lang.String spaceKey)
Deprecated. since 2.10. There is no replacement as this functionality was superseded by multiple page permissions (CONF-3701)

Specified by:
getLockedContentBySpace in interface ContentEntityObjectDao

getTrashedContent

public java.util.List getTrashedContent(java.lang.String spaceKey)
Specified by:
getTrashedContent in interface ContentEntityObjectDao

findContentBySpaceIdAndStatus

public java.util.List<ContentEntityObject> findContentBySpaceIdAndStatus(long spaceId,
                                                                         java.lang.String status,
                                                                         int offset,
                                                                         int count)
Description copied from interface: ContentEntityObjectDao
Retrieve content for a given space with a particular status. Results will be sorted by descending date of last modification.

Specified by:
findContentBySpaceIdAndStatus in interface ContentEntityObjectDao
Parameters:
spaceId - the id of the space
status - 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 retrieve
Returns:
the list of content matching the query

findContentBySpaceIdAndStatus

public PageResponse<ContentEntityObject> findContentBySpaceIdAndStatus(long spaceId,
                                                                       java.lang.String status,
                                                                       LimitedRequest limitedRequest,
                                                                       com.google.common.base.Predicate<Page> predicate)
Description copied from interface: ContentEntityObjectDao
Retrieve content for a given space with a particular status. Results will be sorted by descending date of last modification.

Specified by:
findContentBySpaceIdAndStatus in interface ContentEntityObjectDao
Parameters:
spaceId - the id of the space
status - the status of the content being retrieved (e.g. ContentEntityObject.DELETED
limitedRequest - - the start and offset of the pages to retrieve
predicate - - a predicate to filter the returned results by
Returns:
a PageResponse of ContentEntityObjects in the space with the given status

countContentBySpaceIdAndStatus

public int countContentBySpaceIdAndStatus(long spaceId,
                                          java.lang.String status)
Description copied from interface: ContentEntityObjectDao
Retrieve the count of content for a given space with a particular status.

Specified by:
countContentBySpaceIdAndStatus in interface ContentEntityObjectDao
Parameters:
spaceId - the id of the space
status - the status of the content being retrieved (e.g. ContentEntityObject.DELETED
Returns:
the number of content objects with that status in that space

getObjectType

public java.lang.String getObjectType(long id)
Specified by:
getObjectType in interface ContentEntityObjectDao

getVersionHistorySummary

public java.util.List<VersionHistorySummary> getVersionHistorySummary(long originalContentId)
Specified by:
getVersionHistorySummary in interface ContentEntityObjectDao

findPreviousVersions

public java.util.List findPreviousVersions(long originalContentId)
Specified by:
findPreviousVersions in interface ContentEntityObjectDao

findHistoricalVersionsAfterVersion

public java.util.List findHistoricalVersionsAfterVersion(long originalContentId,
                                                         int version)
Specified by:
findHistoricalVersionsAfterVersion in interface ContentEntityObjectDao

getOldestPageCreationDate

public java.util.Date getOldestPageCreationDate()
Description copied from interface: ContentEntityObjectDao
Gets the creation date of the oldest page.

Specified by:
getOldestPageCreationDate in interface ContentEntityObjectDao
Returns:
creation date of the oldest page in Confluence


Copyright © 2003-2014 Atlassian. All Rights Reserved.