java.lang.Object | ||||
↳ | org.springframework.dao.support.DaoSupport | |||
↳ | org.springframework.orm.hibernate.support.HibernateDaoSupport | |||
↳ | com.atlassian.hibernate.HibernateObjectDao | |||
↳ | com.atlassian.confluence.pages.persistence.dao.hibernate.HibernateAttachmentDataDao |
This class defines an AttachmentDataDao that stores Attachment data in a Hibernate-managed database.
As a result, it is transactional (can be rolled back), so it implements the TransactionalAttachmentDataDao interface.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.atlassian.hibernate.HibernateObjectDao
| |||||||||||
From class
org.springframework.dao.support.DaoSupport
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Once a data migration has occurred, remove all records from the table,
as they are no longer necessary, and we don't want foreign key violations
to occur when removing Attachments.
| |||||||||||
Find all objects of the class provided by getPersistentClass()
| |||||||||||
Find all objects currently persisted of a particular type and sort results by named property.
| |||||||||||
Grabs the AttachmentData object for an Attachment
| |||||||||||
Moves an attachment to a new file name or content object
| |||||||||||
This implementation clears out the Attachment data table, so we
have a clean base for migration.
| |||||||||||
Removes all attachment data for the given attachment.
| |||||||||||
Sets the data for attachment
This method will overwrite any existing data for the attachment.
| |||||||||||
Save an object.
| |||||||||||
Saves data to the attachment data store
| |||||||||||
Saves data to the attachment data store, for an attachment
that has been updated.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Retrieves the attachment data object for a given attachment.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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.pages.persistence.dao.AttachmentDataDao
| |||||||||||
From interface
org.springframework.beans.factory.InitializingBean
|
Once a data migration has occurred, remove all records from the table, as they are no longer necessary, and we don't want foreign key violations to occur when removing Attachments. It circumvents hibernate, so should only be called when nobody else can see the data.
Find all objects of the class provided by getPersistentClass()
Find all objects currently persisted of a particular type and sort results by named property.
s | the name of the property to be sorted on. This should be null if no sorting is required. |
---|
Grabs the AttachmentData object for an Attachment
attachment | the Attachment representing the data |
---|
Moves an attachment to a new file name or content object
attachment | the Attachment to be moved |
---|---|
oldAttachment | the original version of the attachment |
newContent | the new content the Attachment belongs to |
This implementation clears out the Attachment data table, so we have a clean base for migration. It circumvents hibernate, so should only be called when nobody else can see the attachment data.
Removes all attachment data for the given attachment. Since Confluence 4.2 the contract of this method has been clarified. It now removes all versions of the given attachment.
attachment | The latest version of the attachment for which data should be removed |
---|---|
originalContent | The content the attachment belongs to |
Sets the data for attachment This method will overwrite any existing data for the attachment.
attachment | Attachment the data belongs to |
---|---|
data | the data to be saved |
Save an object. The object's last-modified time will be updated, and if the object is searchable it will be indexed.
Saves data to the attachment data store
attachment | the Attachment the data belongs to |
---|---|
data | the InputStream to be written |
Saves data to the attachment data store, for an attachment that has been updated.
This method assumes that the attachment has already been saved.attachment | the new version of the attachment |
---|---|
previousVersion | the previous version of the attachment |
data | the InputStream representing the data |
Retrieves the attachment data object for a given attachment.
attachment | the attachment to retrieve data for |
---|
AttachmentDataNotFoundException | if the attachment data is not found |
---|---|
IncorrectResultSizeDataAccessException | if the database contains more than one data object associated with the given attachment |