public class DefaultContentDao extends ContentEntityObjectHibernateDao implements ContentDao
For this reason, you should always do object CRUD through the DAO, you shouldn't trust Hibernate to do it for you: Hibernate will save the object, but skip the additional stuff the DAO does.
Subclasses will need to implement the getPersistentClass() method to return the class that the DAO is serving: that way getByClassId() will perform correctly.
Subclasses should also override updateModificationData() if they want to perform any additional modifications on objects that are being saved through the DAO. Just remember to call super. (updateModificationData will not be called if an object is saved through saveRaw())
HibernateObjectDao.Cacheability
ONE_DAY
cacheFactory, confluenceUserDao
NON_CACHEABLE
Constructor and Description |
---|
DefaultContentDao() |
Modifier and Type | Method and Description |
---|---|
ContentEntityObject |
getById(long id) |
int |
getCountOfLatestXhtmlContent()
This is for internal use only, Do not rely on it as a public API.
|
int |
getCountOfXhtmlContent()
This is for internal use only, Do not rely on it as a public API.
|
int |
getCountOfXhtmlSpaceDescriptions()
This is for internal use only, Do not rely on it as a public API.
|
int |
getLatestContentCount() |
List<ContentEntityObject> |
getLatestOrderedWikiContentFromContentId(long startContentId,
int maxRows) |
List<ContentEntityObject> |
getLatestOrderedXhtmlContentFromContentIds(long startContentId,
long endContentId)
This is for internal use only, Do not rely on it as a public API.
|
List<Long> |
getLatestOrderedXhtmlContentIds(long startContentId,
int maxRows)
This is for internal use only, Do not rely on it as a public API.
|
List<ContentEntityObject> |
getMailEntities(int startRow,
int maxRows) |
int |
getMailEntitiesCount() |
List<ContentEntityObject> |
getOrderedXhtmlContentFromContentId(long startContentId,
int maxRows)
This is for internal use only, Do not rely on it as a public API.
|
Class |
getPersistentClass() |
List<ContentEntityObject> |
getXhtmlSpaceDescriptionsFromContentId(long startContentId,
int maxRows)
This is for internal use only, Do not rely on it as a public API.
|
void |
saveRawWithoutReindex(com.atlassian.core.bean.EntityObject objectToSave)
This is for internal use only, Do not rely on it as a public API.
|
protected void |
updateModificationData(com.atlassian.core.bean.EntityObject objectToSave)
This method overrides the default behaviour which is to get the current user from a thread local
and to set the last updated time to the current time.
|
countContentBySpaceIdAndStatus, findAllDraftsFor, findContentBySpaceIdAndStatus, findContentBySpaceIdAndStatus, findDraftFor, findHistoricalVersionsAfterVersion, findPreviousVersions, findUnpublishedContentWithUserContributions, getAllCurrentEntities, getByClassId, getContentAuthoredByUser, getContributionStatusByUser, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getObjectType, getOldestPageCreationDate, getPageAndBlogPostsVersionsLastEditedByUser, getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getTrashedContent, getVersion, getVersionEditContributors, getVersionHistorySummary, getVersionHistorySummary, getVersionsLastEditedByUser, getVersionsLastEditedByUserNew
findAllSorted, findLatestVersionsCount, findLatestVersionsCount, findLatestVersionsIterator, findLatestVersionsIterator, findNamedQueryStringParams, findNamedQueryStringParams, save, setCacheFactory, setConfluenceUserDao
applyTransactionTimeout, applyTransactionTimeout, checkDaoConfig, createHibernateTemplate, 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, getHibernateTemplate, getSession, getSessionFactory, index, refresh, reIndex, remove, replicate, save, saveRaw, setHibernateTemplate, setIndexer, setSessionFactory, unIndex, uniqueResult
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
countContentBySpaceIdAndStatus, findAllDraftsFor, findContentBySpaceIdAndStatus, findContentBySpaceIdAndStatus, findDraftFor, findHistoricalVersionsAfterVersion, findPreviousVersions, findUnpublishedContentWithUserContributions, getAllCurrentEntities, getContentAuthoredByUser, getContributionStatusByUser, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getObjectType, getOldestPageCreationDate, getPageAndBlogPostsVersionsLastEditedByUser, getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getTrashedContent, getVersion, getVersionEditContributors, getVersionHistorySummary, getVersionHistorySummary, getVersionsLastEditedByUser, getVersionsLastEditedByUserNew
findLatestVersionsCount, findLatestVersionsIterator, save
findAll, findAllSorted, findAllSorted, findByClassIds, refresh, remove, replicate, save, saveRaw
public ContentEntityObject getById(long id)
getById
in interface ContentDao
getById
in interface ContentEntityObjectDao
getById
in class ContentEntityObjectHibernateDao
public Class getPersistentClass()
getPersistentClass
in interface ObjectDao
getPersistentClass
in class ContentEntityObjectHibernateDao
public int getLatestContentCount()
getLatestContentCount
in interface ContentDao
public List<ContentEntityObject> getLatestOrderedWikiContentFromContentId(long startContentId, int maxRows)
getLatestOrderedWikiContentFromContentId
in interface ContentDao
startContentId
- start content idmaxRows
- max rowspublic List<ContentEntityObject> getOrderedXhtmlContentFromContentId(long startContentId, int maxRows)
ContentDao
This is for internal use only, Do not rely on it as a public API. This is used to retrieve batches of data during migration or upgrades.
Warning: You will want to keep maxRows as small as possible because a list of CEO can be a very memory hungry structure. A good example is the default used in content migration which is 500.
getOrderedXhtmlContentFromContentId
in interface ContentDao
public List<ContentEntityObject> getLatestOrderedXhtmlContentFromContentIds(long startContentId, long endContentId)
ContentDao
This is for internal use only, Do not rely on it as a public API. This is used to retrieve batches of data during migration or upgrades.
Warning: You will want to keep maxRows as small as possible because a list of CEO can be a very memory hungry structure. A good example is the default used in content migration which is 500.
getLatestOrderedXhtmlContentFromContentIds
in interface ContentDao
public List<Long> getLatestOrderedXhtmlContentIds(long startContentId, int maxRows)
ContentDao
This is for internal use only, Do not rely on it as a public API. This is used to retrieve batches of data during migration or upgrades.
getLatestOrderedXhtmlContentIds
in interface ContentDao
public int getCountOfXhtmlContent()
ContentDao
This is for internal use only, Do not rely on it as a public API.
This is used to calculate the amount of work required when migrating or upgrading content.
getCountOfXhtmlContent
in interface ContentDao
public int getCountOfLatestXhtmlContent()
ContentDao
This is for internal use only, Do not rely on it as a public API.
This is used to calculate the amount of work required when migrating or upgrading content.
getCountOfLatestXhtmlContent
in interface ContentDao
public void saveRawWithoutReindex(com.atlassian.core.bean.EntityObject objectToSave)
ContentDao
This is for internal use only, Do not rely on it as a public API.
Perform a saveRaw but without performing the re-index; it is unnecessary in the context of a migration or upgrade.
saveRawWithoutReindex
in interface ContentDao
public int getMailEntitiesCount()
getMailEntitiesCount
in interface ContentDao
public List<ContentEntityObject> getMailEntities(int startRow, int maxRows)
getMailEntities
in interface ContentDao
public List<ContentEntityObject> getXhtmlSpaceDescriptionsFromContentId(long startContentId, int maxRows)
ContentDao
This is for internal use only, Do not rely on it as a public API. This is used to retrieve batches of data during migration or upgrades.
Warning: You will want to keep maxRows as small as possible because a list of CEO can be a very memory hungry structure. A good example is the default used in content migration which is 500.
getXhtmlSpaceDescriptionsFromContentId
in interface ContentDao
public int getCountOfXhtmlSpaceDescriptions()
ContentDao
This is for internal use only, Do not rely on it as a public API.
This is used to calculate the amount of work required when migrating or upgrading content.
getCountOfXhtmlSpaceDescriptions
in interface ContentDao
protected void updateModificationData(com.atlassian.core.bean.EntityObject objectToSave)
We do however need to set the creationdate if it is not set.
updateModificationData
in class VersionedHibernateObjectDao
objectToSave
- Copyright © 2003–2017 Atlassian. All rights reserved.