Interface MailRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Mail,,Mail.MailKey> org.springframework.data.jpa.repository.JpaRepository<Mail,,Mail.MailKey> org.springframework.data.repository.ListCrudRepository<Mail,,Mail.MailKey> org.springframework.data.repository.ListPagingAndSortingRepository<Mail,,Mail.MailKey> org.springframework.data.repository.PagingAndSortingRepository<Mail,,Mail.MailKey> org.springframework.data.repository.query.QueryByExampleExecutor<Mail>,org.springframework.data.repository.Repository<Mail,Mail.MailKey>
@Repository
public interface MailRepository
extends org.springframework.data.jpa.repository.JpaRepository<Mail,Mail.MailKey>
메일 레파지토리 인터페이스
-
Method Summary
Modifier and TypeMethodDescriptionlongcountByMailbox(MailBox mailbox) 메일함 아이디로 메일을 찾아서 해당 메일함에 있는 모든 메일의 개수를 가져옴longcountByMailboxAndMailIsSeen(MailBox mailbox, Boolean mailIsSeen) 메일함에서 읽음 여부에 따라 메일의 개수를 가져옴findDeletedMailByMailBoxId(Long mailboxId) 진짜 삭제된 메일을 찾아서 해당 메일함에 있는 모든 메일을 가져옴Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
countByMailbox
메일함 아이디로 메일을 찾아서 해당 메일함에 있는 모든 메일의 개수를 가져옴- Parameters:
mailbox- 메일함- Returns:
- 메일함에 있는 모든 메일
-
countByMailboxAndMailIsSeen
메일함에서 읽음 여부에 따라 메일의 개수를 가져옴- Parameters:
mailbox- 메일함mailIsSeen- 메일 읽음 여부
-
findDeletedMailByMailBoxId
@Query(value="select * from JAMES_MAIL where MAILBOX_ID = ?1 and MAIL_IS_DELETED = true", nativeQuery=true) List<Mail> findDeletedMailByMailBoxId(Long mailboxId) 진짜 삭제된 메일을 찾아서 해당 메일함에 있는 모든 메일을 가져옴- Parameters:
mailboxId- 메일함 아이디- Returns:
- 메일함에 있는 모든 메일
-