|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.orm.hibernate.support.HibernateDaoSupport com.atlassian.hibernate.HibernateObjectDao bucket.core.persistence.hibernate.CachableHibernateObjectDao 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.
Field Summary |
Fields inherited from class bucket.core.persistence.hibernate.CachableHibernateObjectDao |
cacheManager |
Fields inherited from class com.atlassian.hibernate.HibernateObjectDao |
log |
Fields inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport |
logger |
Constructor Summary | |
HibernateAttachmentDataDao()
|
Method Summary | |
void |
afterMigrationFrom()
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. |
List |
findAll()
|
List |
findAllSorted(String s)
|
protected AttachmentData |
getAttachmentDataForAttachment(Attachment attachment)
|
InputStream |
getDataForAttachment(Attachment attachment)
Grabs the AttachmentData object for an Attachment |
Class |
getPersistentClass()
|
void |
moveAttachment(Attachment attachment,
Attachment oldAttachment,
ContentEntityObject newContent)
Moves an attachment to a new file name or content object |
void |
prepareForMigrationTo()
This implementation clears out the Attachment data table, so we have a clean base for migration. |
void |
removeDataForAttachment(Attachment attachment,
ContentEntityObject originalContent)
Removes all attachment data for an attachment |
void |
replaceDataForAttachment(Attachment attachment,
InputStream data)
Sets the data for attachment This method will overwrite any existing data for the attachment. |
void |
save(EntityObject objectToSave)
|
void |
saveDataForAttachment(Attachment attachment,
InputStream data)
Saves data to the attachment data store |
void |
saveDataForAttachmentVersion(Attachment attachment,
Attachment previousVersion,
InputStream data)
Saves data to the attachment data store, for an attachment that has been updated. |
Methods inherited from class bucket.core.persistence.hibernate.CachableHibernateObjectDao |
setCacheManager |
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport |
afterPropertiesSet, closeSessionIfNecessary, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, initDao, setHibernateTemplate, setSessionFactory |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HibernateAttachmentDataDao()
Method Detail |
public List findAll()
findAll
in interface ObjectDao
public List findAllSorted(String s)
findAllSorted
in interface ObjectDao
public void save(EntityObject objectToSave)
save
in interface ObjectDao
public Class getPersistentClass()
getPersistentClass
in interface ObjectDao
protected AttachmentData getAttachmentDataForAttachment(Attachment attachment) throws AttachmentDataNotFoundException
AttachmentDataNotFoundException
public InputStream getDataForAttachment(Attachment attachment) throws AttachmentDataNotFoundException
AttachmentDataDao
getDataForAttachment
in interface AttachmentDataDao
attachment
- the Attachment representing the data
AttachmentDataNotFoundException
- if no data was foundpublic void removeDataForAttachment(Attachment attachment, ContentEntityObject originalContent)
AttachmentDataDao
removeDataForAttachment
in interface AttachmentDataDao
attachment
- The attachment for which data should be removedoriginalContent
- The content the attachment belongs topublic void saveDataForAttachment(Attachment attachment, InputStream data)
AttachmentDataDao
saveDataForAttachment
in interface AttachmentDataDao
attachment
- the Attachment the data belongs todata
- the InputStream to be writtenpublic void saveDataForAttachmentVersion(Attachment attachment, Attachment previousVersion, InputStream data)
AttachmentDataDao
saveDataForAttachmentVersion
in interface AttachmentDataDao
attachment
- the new version of the attachmentpreviousVersion
- the previous version of the attachmentdata
- the InputStream representing the datapublic void replaceDataForAttachment(Attachment attachment, InputStream data)
AttachmentDataDao
replaceDataForAttachment
in interface AttachmentDataDao
attachment
- Attachment the data belongs todata
- the data to be savedpublic void moveAttachment(Attachment attachment, Attachment oldAttachment, ContentEntityObject newContent)
AttachmentDataDao
moveAttachment
in interface AttachmentDataDao
attachment
- the Attachment to be movedoldAttachment
- the original version of the attachmentnewContent
- the new content the Attachment belongs topublic void prepareForMigrationTo()
prepareForMigrationTo
in interface AttachmentDataDao
public void afterMigrationFrom()
afterMigrationFrom
in interface AttachmentDataDao
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |