Class TransactionalHibernateAttachmentDao
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao<T>
-
- com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao<Attachment>
-
- com.atlassian.confluence.pages.persistence.dao.hibernate.AbstractHibernateAttachmentDao
-
- com.atlassian.confluence.pages.persistence.dao.hibernate.TransactionalHibernateAttachmentDao
-
- All Implemented Interfaces:
ObjectDao
,VersionedObjectDao<Attachment>
,AttachmentDaoInternal
,ObjectDaoInternal<Attachment>
,VersionedObjectDaoInternal<Attachment>
,AttachmentDao
,FlushableCachingDao
,org.springframework.beans.factory.InitializingBean
public class TransactionalHibernateAttachmentDao extends AbstractHibernateAttachmentDao
Transactional version of the AbstractHibernateAttachmentDao, which removes the Attachment data as the Attachment itself is being removed, since it can be rolled back by the transaction- See Also:
AbstractHibernateAttachmentDao
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.atlassian.confluence.pages.persistence.dao.hibernate.AbstractHibernateAttachmentDao
AbstractHibernateAttachmentDao.IntraHibernateAttachmentCopier, AbstractHibernateAttachmentDao.IntraHibernateAttachmentMigrator
-
Nested classes/interfaces inherited from class com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao
HibernateObjectDao.Cacheability
-
Nested classes/interfaces inherited from interface com.atlassian.confluence.pages.persistence.dao.AttachmentDao
AttachmentDao.AttachmentCopier, AttachmentDao.AttachmentMigrator
-
-
Field Summary
-
Fields inherited from class com.atlassian.confluence.pages.persistence.dao.hibernate.AbstractHibernateAttachmentDao
dataDao
-
Fields inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
cacheFactory, confluenceUserDao
-
-
Constructor Summary
Constructors Constructor Description TransactionalHibernateAttachmentDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Attachment>
removeAllVersionsFromServer(Attachment attachment)
Removes all versions of an attachmentvoid
removeAttachmentFromServer(Attachment attachment)
Removes attachment (and all of its versions)protected void
removeAttachmentVersionFromServer(Attachment attachmentVersionToBeRemoved, Attachment previousAttachmentVersion)
void
setDataDao(TransactionalAttachmentDataDao dao)
We override the parent setter here so we are certain we're getting a transactional AttachmentDataDao to work with-
Methods inherited from class com.atlassian.confluence.pages.persistence.dao.hibernate.AbstractHibernateAttachmentDao
afterMigrationFrom, countLatestVersionsOfAttachments, countLatestVersionsOfAttachmentsOnPageSince, countLatestVersionsOfAttachmentsWithAnyStatus, findAllVersions, findAllVersions, findLatestVersionIds, findLatestVersionIds, findLatestVersionIdsIterator, findLatestVersionIdsIterator, flush, getAttachment, getAttachmentData, getAttachmentData, getAttachmentStatistics, getBackingStorageType, getById, getByIds, getCopier, getDataDao, getInstance, getLastAddedVersionsOf, getLatestAttachment, getLatestVersionsOfAttachments, getLatestVersionsOfAttachments, getLatestVersionsOfAttachmentsForMultipleCeos, getLatestVersionsOfAttachmentsWithAnyStatus, getLatestVersionsOfAttachmentsWithAnyStatusForContainers, getMigrator, getPersistentClass, getRemappedAttachmentIds, isAttachmentPresent, moveAttachment, overwriteMetaData, prepareForMigrationTo, removeAllAttachmentVersions, removeAttachment, removeAttachmentVersionFromServer, removeMetaData, replaceAttachmentData, saveNewAttachment, saveNewAttachmentVersion, updateAttachment
-
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
findAllSorted, findLatestVersionsCount, findLatestVersionsCount, findLatestVersionsIterator, findLatestVersionsIterator, findNamedQueryStringParams, findNamedQueryStringParams, save, saveEntity, setCacheFactory, setConfluenceUserDao, updateEntityModificationData, updateModificationData
-
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao
applyTransactionTimeout, 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, getByClassId, getCountResult, getHibernateTemplate, getSessionFactory, index, indexEntity, refresh, refreshEntity, reIndex, reIndexEntity, remove, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity, setEventPublisher, setHibernateTemplate, setIndexer, setSessionFactory, unIndex, unIndexEntity, uniqueResult
-
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.pages.persistence.dao.AttachmentDao
findAll, findLatestVersionsIterator
-
Methods inherited from interface com.atlassian.confluence.internal.pages.persistence.AttachmentDaoInternal
getFilteredLatestVersionsOfAttachments
-
Methods inherited from interface com.atlassian.confluence.internal.persistence.ObjectDaoInternal
findAll, findAllSorted, findByClassIds, findByClassIdsFiltered, refresh, refreshEntity, remove, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity
-
-
-
-
Method Detail
-
setDataDao
public void setDataDao(TransactionalAttachmentDataDao dao)
We override the parent setter here so we are certain we're getting a transactional AttachmentDataDao to work with- Parameters:
dao
-
-
removeAttachmentFromServer
public void removeAttachmentFromServer(Attachment attachment)
Description copied from interface:AttachmentDao
Removes attachment (and all of its versions)- Parameters:
attachment
- the Attachment to be removed
-
removeAllVersionsFromServer
public List<Attachment> removeAllVersionsFromServer(Attachment attachment)
Description copied from interface:AttachmentDaoInternal
Removes all versions of an attachment- Parameters:
attachment
- the Attachment to be removed- Returns:
- all versions that have been removed
-
removeAttachmentVersionFromServer
protected void removeAttachmentVersionFromServer(Attachment attachmentVersionToBeRemoved, Attachment previousAttachmentVersion)
- Specified by:
removeAttachmentVersionFromServer
in classAbstractHibernateAttachmentDao
-
-