com.atlassian.confluence.mail.persistence.dao.hibernate
Class HibernateMailDao
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
com.atlassian.confluence.core.persistence.hibernate.ContentEntityObjectHibernateDao
com.atlassian.confluence.mail.persistence.dao.hibernate.HibernateMailDao
- All Implemented Interfaces:
- ObjectDao, ContentEntityObjectDao, VersionedObjectDao, MailDao, org.springframework.beans.factory.InitializingBean
public class HibernateMailDao
- extends ContentEntityObjectHibernateDao
- implements MailDao
Fields inherited from class org.springframework.dao.support.DaoSupport |
logger |
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.ContentEntityObjectHibernateDao |
findPreviousVersions, getAllCurrentEntities, getById, getContentAuthoredByUser, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getLockedContentBySpace, getObjectType, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getTrashedContent, getVersion, getVersionHistorySummary |
Methods inherited from class com.atlassian.hibernate.HibernateObjectDao |
findAll, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getByClassId, index, refresh, reIndex, remove, replicate, save, saveRaw, setIndexer, unIndex |
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport |
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory |
Methods inherited from class org.springframework.dao.support.DaoSupport |
afterPropertiesSet, initDao |
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.core.persistence.ContentEntityObjectDao |
findPreviousVersions, getAllCurrentEntities, getById, getContentAuthoredByUser, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getLockedContentBySpace, getObjectType, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getTrashedContent, getVersion, getVersionHistorySummary |
HibernateMailDao
public HibernateMailDao()
getPersistentClass
public Class getPersistentClass()
- Specified by:
getPersistentClass
in interface ObjectDao
- Overrides:
getPersistentClass
in class ContentEntityObjectHibernateDao
getMailById
public Mail getMailById(long id)
- Description copied from interface:
MailDao
- Retrieve a single mail by its persistent object id. Returns null if no
Mail is found with that id
- Specified by:
getMailById
in interface MailDao
- Parameters:
id
- the id of the mail to retrieve
- Returns:
- the appropriate Mail object, or null if no such mail exists
getMailByMessageId
public Mail getMailByMessageId(String messageId)
- Description copied from interface:
MailDao
- Retrieve a single mail by its message-id. Since message ids are not guaranteed to be
unique (but should be in practice), this method will return null both if no message
exists with that ID, or if multiple mails exist with that ID. To determine which is
the case, call
MailDao.getMailsByMessageId(java.lang.String)
.
Message ids are case sensitive.
- Specified by:
getMailByMessageId
in interface MailDao
- Parameters:
messageId
- the Message-Id of the mail to retrieve
- Returns:
- the appropriate Mail object, or null if no such mail exists, or if multiple
mails exist with that ID
getMailsByMessageId
public List getMailsByMessageId(String messageId)
- Description copied from interface:
MailDao
- Retrieve all mails with a particular message id. Since message ids are supposed to be
unique, you will mostly want to just use
MailDao.getMailByMessageId(java.lang.String)
instead, but this
method is useful if you want to cater for the possibility of (unlikely) accidental
clashes or (more likely) deliberate forgeries.
Message ids are case sensitive
- Specified by:
getMailsByMessageId
in interface MailDao
- Parameters:
messageId
- The Message-Id of the mail to retrieve
- Returns:
- a list of all mails matching that message-id, or the empty list if no such
mails exist.
getMostRecentMail
public Mail getMostRecentMail(String spaceKey)
- Specified by:
getMostRecentMail
in interface MailDao
getFirstMailAfter
public Mail getFirstMailAfter(String spaceKey,
long mailId)
- Specified by:
getFirstMailAfter
in interface MailDao
getFirstMailBefore
public Mail getFirstMailBefore(String spaceKey,
long mailId)
- Specified by:
getFirstMailBefore
in interface MailDao
getSpaceMailIterator
public Iterator getSpaceMailIterator(String spaceKey)
- Specified by:
getSpaceMailIterator
in interface MailDao
getSpaceMailWithAttachmentsIterator
public Iterator getSpaceMailWithAttachmentsIterator(String spaceKey)
- Specified by:
getSpaceMailWithAttachmentsIterator
in interface MailDao
findMailTotal
public int findMailTotal(Space space)
- Specified by:
findMailTotal
in interface MailDao
getSpaceMail
public List getSpaceMail(int firstResult,
int maxResults,
String spaceKey)
- Specified by:
getSpaceMail
in interface MailDao
getMail
public List getMail(Space space,
boolean currentOnly)
- Specified by:
getMail
in interface MailDao
removeAllMail
public void removeAllMail(Space space)
- bulk mail removal using direct jdbc (too slow using hibernate, as it loads all mails into session prior to deletion which is bad)
- Specified by:
removeAllMail
in interface MailDao
- Parameters:
space
-