public class DefaultContentDao extends AbstractContentEntityObjectHibernateDao<ContentEntityObject> implements ContentDaoInternal
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 ObjectDaoInternal.getPersistentClass() method to return the class
that the DAO is serving: that way getByClassId() will perform correctly.
Subclasses should also override HibernateObjectDao.updateModificationData(EntityObject) 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 HibernateObjectDao.saveRawEntity(EntityObject))
HibernateObjectDao.CacheabilitycacheFactory, confluenceUserDao| Constructor and Description |
|---|
DefaultContentDao() |
| Modifier and Type | Method and Description |
|---|---|
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> |
getOrderedXhtmlContentFromContentId(long startContentId,
int maxRows)
This is for internal use only, Do not rely on it as a public API.
|
Class<ContentEntityObject> |
getPersistentClass()
Gets the type of
EntityObject this Dao works with. |
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 |
updateEntityModificationData(ContentEntityObject objectToSave) |
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, findAllLegacyDraftsFor, findContentBySpaceIdAndStatus, findContentBySpaceIdAndStatus, findDraftFor, findDraftsWithUnpublishedChangesForUser, findHistoricalVersionsAfterVersion, findPreviousVersions, findUnpublishedContentWithUserContributions, getAllCurrentEntities, getAllModifiers, getByClassId, getById, getContentAuthoredByUser, getContributionStatusByUser, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getObjectType, getOldestPageCreationDate, getPageAndBlogPostsVersionsLastEditedByUser, getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getTrashedContent, getTrashedContents, getTrashedEntities, getVersion, getVersionEditContributors, getVersionHistorySummary, getVersionHistorySummary, getVersionsLastEditedByUser, getVersionsLastEditedByUserNewfindAllSorted, findLatestVersionsCount, findLatestVersionsCount, findLatestVersionsIterator, findLatestVersionsIterator, findNamedQueryStringParams, findNamedQueryStringParams, save, saveEntity, setCacheFactory, setConfluenceUserDaoapplyTransactionTimeout, applyTransactionTimeout, checkDaoConfig, createHibernateTemplate, findAll, findAllSorted, findByClassIds, findByClassIdsFiltered, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getCountResult, getHibernateTemplate, getSession, getSessionFactory, index, indexEntity, refresh, refreshEntity, reIndex, reIndexEntity, remove, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity, setEventPublisher, setHibernateTemplate, setIndexer, setSessionFactory, unIndex, unIndexEntity, uniqueResultclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetByIdfindContentBySpaceIdAndStatusAndFilter, getTrashedEntitiescountContentBySpaceIdAndStatus, findAllDraftsFor, findAllLegacyDraftsFor, findContentBySpaceIdAndStatus, findContentBySpaceIdAndStatus, findDraftFor, findDraftsWithUnpublishedChangesForUser, findHistoricalVersionsAfterVersion, findPreviousVersions, findUnpublishedContentWithUserContributions, getAllCurrentEntities, getAllModifiers, getAllModifiers, getContentAuthoredByUser, getContributionStatusByUser, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getObjectType, getOldestPageCreationDate, getPageAndBlogPostsVersionsLastEditedByUser, getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getTrashedContent, getTrashedContents, getVersion, getVersionEditContributors, getVersionHistorySummary, getVersionHistorySummary, getVersionsLastEditedByUser, getVersionsLastEditedByUserNewsaveEntityfindLatestVersionsCount, findLatestVersionsIterator, savefindAll, findAllSorted, findAllSorted, findByClassIds, findByClassIdsFiltered, refresh, refreshEntity, remove, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntitypublic Class<ContentEntityObject> getPersistentClass()
ObjectDaoInternalEntityObject this Dao works with.getPersistentClass in interface ObjectDaogetPersistentClass in interface ObjectDaoInternal<ContentEntityObject>public int getLatestContentCount()
getLatestContentCount in interface ContentDaopublic List<ContentEntityObject> getLatestOrderedWikiContentFromContentId(long startContentId, int maxRows)
getLatestOrderedWikiContentFromContentId in interface ContentDaostartContentId - start content idmaxRows - max rowspublic List<ContentEntityObject> getOrderedXhtmlContentFromContentId(long startContentId, int maxRows)
ContentDaoThis 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 ContentDaopublic List<ContentEntityObject> getLatestOrderedXhtmlContentFromContentIds(long startContentId, long endContentId)
ContentDaoThis 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 ContentDaopublic List<Long> getLatestOrderedXhtmlContentIds(long startContentId, int maxRows)
ContentDaoThis 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 ContentDaopublic int getCountOfXhtmlContent()
ContentDaoThis 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 ContentDaopublic int getCountOfLatestXhtmlContent()
ContentDaoThis 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 ContentDaopublic void saveRawWithoutReindex(com.atlassian.core.bean.EntityObject objectToSave)
ContentDaoThis 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 ContentDaosaveRawWithoutReindex in interface ContentEntityObjectDaoInternal<ContentEntityObject>public List<ContentEntityObject> getXhtmlSpaceDescriptionsFromContentId(long startContentId, int maxRows)
ContentDaoThis 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 ContentDaopublic int getCountOfXhtmlSpaceDescriptions()
ContentDaoThis 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 ContentDaoprotected 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<ContentEntityObject>objectToSave - the object that is about to be savedprotected void updateEntityModificationData(ContentEntityObject objectToSave)
updateEntityModificationData in class VersionedHibernateObjectDao<ContentEntityObject>Copyright © 2003–2023 Atlassian. All rights reserved.