Class HibernateDraftDao
java.lang.Object
org.springframework.dao.support.DaoSupport
com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao<Draft>
com.atlassian.confluence.impl.pages.persistence.dao.HibernateDraftDao
- All Implemented Interfaces:
- DraftDao,- org.springframework.beans.factory.InitializingBean
Database storage for drafts. Does not permit anonymous drafts (i.e. those with a null username),
 which should be stored in non-permanent storage like the HTTP session.
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDaoHibernateObjectDao.Cacheability
- 
Field SummaryFields inherited from class org.springframework.dao.support.DaoSupportlogger
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintcountDrafts(ConfluenceUser creator) findByCreator(ConfluenceUser creator) Returns the drafts stored against the given username.protected DraftgetByClassId(long id) Retrieve the object with a particular id from the database.getDraft(long draftId) Returns the draft with the given ID, or null if no draft is found with that ID.getDraft(String pageId, ConfluenceUser creator, String draftType, String spaceKey) Finds and returns a draft object with all the specified properties or null if none is found.protected voidvoidRemove an object from the databasevoidsaveOrUpdate(Draft draft) Saves the draft.voidsetEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher) Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDaoapplyTransactionTimeout, checkDaoConfig, createHibernateTemplate, findAll, findAllSorted, findAllSorted, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getCountResult, getHibernateTemplate, getSessionFactory, reIndex, save, saveEntity, saveRaw, setHibernateTemplate, setSessionFactory, uniqueResult, updateModificationDataMethods inherited from class org.springframework.dao.support.DaoSupportafterPropertiesSet, initDao
- 
Constructor Details- 
HibernateDraftDaopublic HibernateDraftDao(org.hibernate.SessionFactory sessionFactory) 
 
- 
- 
Method Details- 
getPersistentClass- Specified by:
- getPersistentClassin class- HibernateObjectDao<Draft>
 
- 
getByClassIdDescription copied from class:HibernateObjectDaoRetrieve 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:
- getByClassIdin class- HibernateObjectDao<Draft>
- 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.
 
- 
saveOrUpdateDescription copied from interface:DraftDaoSaves the draft.- Specified by:
- saveOrUpdatein interface- DraftDao
- Throws:
- IllegalArgumentException- if the draft has no page ID, owner or type.
 
- 
getDraftDescription copied from interface:DraftDaoFinds and returns a draft object with all the specified properties or null if none is found.- Specified by:
- getDraftin interface- DraftDao
- Parameters:
- pageId- the id of the page which this draft is associated with
- creator- the owner of the draft
- draftType- the type of draft, which is usually the result of calling- ContentEntityObject.getType()
- spaceKey- space key, if relevant for the draft. This is used to enable NEW page drafts across multiple spaces
- Returns:
- a draft object with all the specified properties or null if no valid draft could be found
 
- 
getDraftDescription copied from interface:DraftDaoReturns the draft with the given ID, or null if no draft is found with that ID.
- 
removeDescription copied from class:HibernateObjectDaoRemove an object from the database- Specified by:
- removein interface- DraftDao
- Overrides:
- removein class- HibernateObjectDao<Draft>
- Parameters:
- draft- the object to remove
 
- 
findByCreatorDescription copied from interface:DraftDaoReturns the drafts stored against the given username.- Specified by:
- findByCreatorin interface- DraftDao
 
- 
countDrafts- Specified by:
- countDraftsin interface- DraftDao
- Returns:
- count of number of drafts for this daos owner
 
- 
setEventPublisherpublic void setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher) 
- 
publishEvent- Overrides:
- publishEventin class- HibernateObjectDao<Draft>
 
 
-