public class JPAMailboxMapper extends JPATransactionalMapper implements MailboxMapper<Long>
Mapper.Transaction<T>, Mapper.VoidTransactionentityManager, entityManagerFactory| Constructor and Description |
|---|
JPAMailboxMapper(javax.persistence.EntityManagerFactory entityManagerFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
commit()
Commit the transaction.
|
void |
delete(Mailbox<Long> mailbox)
Delete the given
Mailbox from the underlying storage |
void |
deleteAllMailboxes() |
void |
deleteAllMemberships() |
Mailbox<Long> |
findMailboxByPath(MailboxPath mailboxPath)
Return the
Mailbox for the given name |
List<Mailbox<Long>> |
findMailboxWithPathLike(MailboxPath path)
Return a List of
Mailbox which name is like the given name |
boolean |
hasChildren(Mailbox<Long> mailbox,
char delimiter)
Return if the given
Mailbox has children |
List<Mailbox<Long>> |
list()
|
void |
save(Mailbox<Long> mailbox)
Save the give
Mailbox to the underlying storage |
begin, endRequest, getEntityManager, rollbackexecuteclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitendRequest, executepublic JPAMailboxMapper(javax.persistence.EntityManagerFactory entityManagerFactory)
protected void commit()
throws MailboxException
MailboxExistsException
will get throwncommit in class JPATransactionalMapperMailboxExceptionpublic void save(Mailbox<Long> mailbox) throws MailboxException
MailboxMapperMailbox to the underlying storagesave in interface MailboxMapper<Long>MailboxExceptionMailboxMapper.save(Mailbox)public Mailbox<Long> findMailboxByPath(MailboxPath mailboxPath) throws MailboxException, MailboxNotFoundException
MailboxMapperMailbox for the given namefindMailboxByPath in interface MailboxMapper<Long>MailboxExceptionMailboxNotFoundExceptionMailboxMapper.findMailboxByPath(MailboxPath)public void delete(Mailbox<Long> mailbox) throws MailboxException
MailboxMapperMailbox from the underlying storagedelete in interface MailboxMapper<Long>MailboxExceptionMailboxMapper.delete(Mailbox)public List<Mailbox<Long>> findMailboxWithPathLike(MailboxPath path) throws MailboxException
MailboxMapperMailbox which name is like the given namefindMailboxWithPathLike in interface MailboxMapper<Long>MailboxExceptionMailboxMapper.findMailboxWithPathLike(MailboxPath)public void deleteAllMemberships()
throws MailboxException
MailboxExceptionpublic void deleteAllMailboxes()
throws MailboxException
MailboxExceptionpublic boolean hasChildren(Mailbox<Long> mailbox, char delimiter) throws MailboxException, MailboxNotFoundException
MailboxMapperMailbox has childrenhasChildren in interface MailboxMapper<Long>mailbox - not nulldelimiter - path delimiterMailboxExceptionMailboxNotFoundExceptionMailboxMapper.hasChildren(Mailbox, char)public List<Mailbox<Long>> list() throws MailboxException
MailboxMapperlist in interface MailboxMapper<Long>MailboxExceptionMailboxMapper.list()Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.