Interface GenericRepository<T>

Type Parameters:
T - エンティティの型
All Known Subinterfaces:
RentalItemRepository, ReservationRepository, UserAccountRepository
All Known Implementing Classes:
AbstractFileRepository, JpaCrudRepository, RentalItemFileRepository, RentalItemJpaRepository, ReservationFileRepository, ReservationJpaRepository, UserAccountFileRepository, UserAccountJpaRepository

public interface GenericRepository<T>
永続先に依らないリポジトリの共通操作
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    コンフィグ定数
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(T entity)
    エンティティを追加する。 実装クラスもしくはメソッドにValidateParamをアノテートすることでメソッド実行前に ValidによりオブジェクトのValidationが実行される。
    void
    delete(T entity)
    エンティティを削除する。
    永続化されているエンティティを全件取得する
    get(int id)
    IDのエンティティを取得する。
    update(T entity)
    エンティティを更新する。
  • Method Details

    • get

      T get(int id)
      IDのエンティティを取得する。
      Parameters:
      id - ID
      Returns:
      エンティティ。該当なしはnull
    • findAll

      List<T> findAll()
      永続化されているエンティティを全件取得する
      Returns:
      エンティティの全件リスト。該当なしは空リスト
    • add

      void add(T entity)
      エンティティを追加する。 実装クラスもしくはメソッドにValidateParamをアノテートすることでメソッド実行前に ValidによりオブジェクトのValidationが実行される。
      Parameters:
      entity - エンティティ
    • update

      T update(T entity)
      エンティティを更新する。
      Parameters:
      entity - 更新内容
      Returns:
      更新後エンティティ。更新対象が存在しない場合はnull
    • delete

      void delete(T entity)
      エンティティを削除する。
      Parameters:
      entity - 削除エンティティ