Interface ContactRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Contact,Long>, org.springframework.data.jpa.repository.JpaRepository<Contact,Long>, org.springframework.data.repository.ListCrudRepository<Contact,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<Contact,Long>, org.springframework.data.repository.PagingAndSortingRepository<Contact,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<Contact>, org.springframework.data.repository.Repository<Contact,Long>

@Repository public interface ContactRepository extends org.springframework.data.jpa.repository.JpaRepository<Contact,Long>
연락처 레포지토리 (Spring Data JPA)
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    사용자와 친구가 이미 연락처인지 확인
    사용자의 친구 목록 조회

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • findByOwner

      List<Contact> findByOwner(User user)
      사용자의 친구 목록 조회
      Parameters:
      user - 사용자
      Returns:
      친구 목록
    • existsByOwnerAndFriend

      boolean existsByOwnerAndFriend(User owner, User friend)
      사용자와 친구가 이미 연락처인지 확인
      Parameters:
      owner - 사용자
      friend - 친구
      Returns:
      연락처 여부(true: 이미 연락처, false: 연락처가 아님)