java.lang.Object | |||||
↳ | org.springframework.dao.support.DaoSupport | ||||
↳ | org.springframework.orm.hibernate.support.HibernateDaoSupport | ||||
↳ | com.atlassian.hibernate.HibernateObjectDao | ||||
↳ | com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao<T extends com.atlassian.core.bean.EntityObject> | ||||
↳ | com.atlassian.confluence.pages.persistence.dao.hibernate.AbstractHibernateAttachmentDao |
Known Direct Subclasses |
Abstract class that defines the basic methods necessary for saving Attachments to a database.
The location of the storage of attachment data is dependent on the AttachmentDataDao set for this class. In some cases, since the removal of attachments is destructive, different implementations may wish to perform the removal of data in a different order. Subclasses will have to implement the #removeDataForAttachment(Attachment attachment) method.Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AbstractHibernateAttachmentDao.IntraHibernateAttachmentCopier | This attachment copier will copy attachment streams from the current instance of AbstractHibernateAttachmentDao to another. | ||||||||||
AbstractHibernateAttachmentDao.IntraHibernateAttachmentMigrator | This attachment migrator will migrate attachment streams from the current instance of AbstractHibernateAttachmentDao to another. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
dataDao |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
| |||||||||||
From class
com.atlassian.hibernate.HibernateObjectDao
| |||||||||||
From class
org.springframework.dao.support.DaoSupport
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This implementation removes all Attachments and
passes the migration tasks onto the AttachmentDataDao
| |||||||||||
Same as
findLatestVersionIdsIterator() but only gets the ids matching the list of spaces requested. | |||||||||||
Same as
findLatestVersionIdsIterator() but only gets the ids matching the list of spaces requested. | |||||||||||
This implementation flushes the Hibernate session.
| |||||||||||
Return the attachment on the specified content with the given filename and version.
| |||||||||||
Retrieves the InputStream representing the data for attachment
| |||||||||||
Returns the attachment with the given persistent ID.
| |||||||||||
Get a copier object to copy attachments between data stores
The source data store will remain untouched
| |||||||||||
Returns the correct instance of AttachmentDao for the AttachmentDataDao that is given.
| |||||||||||
Retrieves all the last added versions for each user who has added a version of the attachment
That is, if a user has added multiple versions, only the latest added version will be added to the list returned.
| |||||||||||
Return the latest version of the attachment on the specified content with the given filename.
| |||||||||||
Retrieves the latest versions of all attachments to ceo
| |||||||||||
Get a migrator object to migrate attachments between attachment datastores.
| |||||||||||
Moves an Attachment to a new file name or content object
This method assumes that the filename and/or content of the attachment
(and its previous versions) have already been updated.
| |||||||||||
This implementation removes the contents of the table and
passes the migration tasks onto the AttachmentDataDao
| |||||||||||
Sets the attachment data for attachment
This method will overwrite any existing data for
the attachment version.
| |||||||||||
Saves a new attachment
| |||||||||||
This implementation saves the Attachment and its previous version to the VersionedHibernateObjectDao.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Severs the connection between attachment and content, and removes the attachment from the database
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
| |||||||||||
From class
com.atlassian.hibernate.HibernateObjectDao
| |||||||||||
From class
org.springframework.orm.hibernate.support.HibernateDaoSupport
| |||||||||||
From class
org.springframework.dao.support.DaoSupport
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
bucket.core.persistence.ObjectDao
| |||||||||||
From interface
com.atlassian.confluence.core.persistence.VersionedObjectDao
| |||||||||||
From interface
com.atlassian.confluence.pages.persistence.dao.AttachmentDao
| |||||||||||
From interface
com.atlassian.confluence.pages.persistence.dao.FlushableCachingDao
| |||||||||||
From interface
org.springframework.beans.factory.InitializingBean
|
This implementation removes all Attachments and passes the migration tasks onto the AttachmentDataDao
Same as findLatestVersionIdsIterator()
but only gets the ids matching the list of spaces requested.
spacesToInclude | list of spaces to include. The length of this list should not exceed the allowed maximum value of an "in" clause. |
---|
Same as findLatestVersionIdsIterator()
but only gets the ids matching the list of spaces requested.
spacesToInclude | list of spaces to include. The length of this list should not exceed the allowed maximum value of an "in" clause. |
---|
This implementation flushes the Hibernate session.
RuntimeException | if there was a problem flushing |
---|
Return the attachment on the specified content with the given filename and version. Returns null if no such attachment exists.
Note: unlikegetAttachment(ContentEntityObject, String, int)
, this method does not accept zero as a special
flag to indicate the latest version of an attachment. To retrieve the latest version
of an attachment, use getLatestAttachment(ContentEntityObject, String)
.content | the content to find the attachment on |
---|---|
fileName | the file name of the attachment, treated case-insensitively |
version | the version of the attachment |
Retrieves the InputStream representing the data for attachment
attachment | the attachment whose data will be returned |
---|
Returns the attachment with the given persistent ID. Returns null if no such attachment exists.
id | the persistent ID of the attachment to retrieve |
---|
Get a copier object to copy attachments between data stores The source data store will remain untouched
destinationDao | dao to copy attachments to |
---|
Returns the correct instance of AttachmentDao for the AttachmentDataDao that is given.
attachmentDataDao | the AttachmentDataDao that should be used |
---|
IllegalArgumentException | if dataDao is not supported |
---|
Retrieves all the last added versions for each user who has added a version of the attachment That is, if a user has added multiple versions, only the latest added version will be added to the list returned. Result will be sorted with the earliest version coming first.
attachment | attachment (must be the latest version) |
---|
Return the latest version of the attachment on the specified content with the given filename. Returns null if no attachment with that name on the content exists.
content | the content to find the attachment on |
---|---|
fileName | the file name of the attachment |
Retrieves the latest versions of all attachments to ceo
content | the content to look up attachments |
---|
Get a migrator object to migrate attachments between attachment datastores. To be used when switching datastore implementations
destinationDao | dao to move attachments to |
---|
Moves an Attachment to a new file name or content object
This method assumes that the filename and/or content of the attachment (and its previous versions) have already been updated.latestVersion | the Attachment to be moved |
---|---|
oldAttachment | the Attachment before it has been updated |
newContent | the new content attachment belongs to |
This implementation removes the contents of the table and passes the migration tasks onto the AttachmentDataDao
Sets the attachment data for attachment This method will overwrite any existing data for the attachment version.
attachment | Attachment the data belongs to |
---|---|
attachmentData | the data to save |
Saves a new attachment
attachment | the Attachment to be saved |
---|---|
attachmentData | the attachment data to be saved |
This implementation saves the Attachment and its previous version to the VersionedHibernateObjectDao.
Due to the way Hibernate works, attachment must be the current Hibernate-managed object (without its version or ID having being changed), and previousVersion should be a clone of the unmodified Attachment object.attachment | the attachment to be saved, a clone of the old one |
---|---|
previousVersion | the old attachment, which must be unmodified |
attachmentData | the new attachment data |
Severs the connection between attachment and content, and removes the attachment from the database
attachment | the attachment to remove |
---|---|
content | the content to remove the attachment from |