public class JPAMailboxMapper extends JPATransactionalMapper implements MailboxMapper<Long>
Mapper.Transaction<T>, Mapper.VoidTransaction
entityManager, 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, rollback
execute
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
endRequest, execute
public JPAMailboxMapper(javax.persistence.EntityManagerFactory entityManagerFactory)
protected void commit() throws MailboxException
MailboxExistsException
will get throwncommit
in class JPATransactionalMapper
MailboxException
public void save(Mailbox<Long> mailbox) throws MailboxException
MailboxMapper
Mailbox
to the underlying storagesave
in interface MailboxMapper<Long>
MailboxException
MailboxMapper.save(Mailbox)
public Mailbox<Long> findMailboxByPath(MailboxPath mailboxPath) throws MailboxException, MailboxNotFoundException
MailboxMapper
Mailbox
for the given namefindMailboxByPath
in interface MailboxMapper<Long>
MailboxException
MailboxNotFoundException
MailboxMapper.findMailboxByPath(MailboxPath)
public void delete(Mailbox<Long> mailbox) throws MailboxException
MailboxMapper
Mailbox
from the underlying storagedelete
in interface MailboxMapper<Long>
MailboxException
MailboxMapper.delete(Mailbox)
public List<Mailbox<Long>> findMailboxWithPathLike(MailboxPath path) throws MailboxException
MailboxMapper
Mailbox
which name is like the given namefindMailboxWithPathLike
in interface MailboxMapper<Long>
MailboxException
MailboxMapper.findMailboxWithPathLike(MailboxPath)
public void deleteAllMemberships() throws MailboxException
MailboxException
public void deleteAllMailboxes() throws MailboxException
MailboxException
public boolean hasChildren(Mailbox<Long> mailbox, char delimiter) throws MailboxException, MailboxNotFoundException
MailboxMapper
Mailbox
has childrenhasChildren
in interface MailboxMapper<Long>
mailbox
- not nulldelimiter
- path delimiterMailboxException
MailboxNotFoundException
MailboxMapper.hasChildren(Mailbox, char)
public List<Mailbox<Long>> list() throws MailboxException
MailboxMapper
list
in interface MailboxMapper<Long>
MailboxException
MailboxMapper.list()
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.