Class JpaCrudRepository<T extends IdAccessable>

java.lang.Object
io.extact.rms.application.persistence.jpa.JpaCrudRepository<T>
All Implemented Interfaces:
GenericRepository<T>
Direct Known Subclasses:
RentalItemJpaRepository, ReservationJpaRepository, UserAccountJpaRepository

public abstract class JpaCrudRepository<T extends IdAccessable> extends Object implements GenericRepository<T>
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.extact.rms.application.persistence.GenericRepository

    GenericRepository.ApiType
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JpaCrudRepository

      public JpaCrudRepository()
  • Method Details

    • get

      public T get(int id)
      Description copied from interface: GenericRepository
      IDのエンティティを取得する。
      Specified by:
      get in interface GenericRepository<T extends IdAccessable>
      Parameters:
      id - ID
      Returns:
      エンティティ。該当なしはnull
    • findAll

      public List<T> findAll()
      Description copied from interface: GenericRepository
      永続化されているエンティティを全件取得する
      Specified by:
      findAll in interface GenericRepository<T extends IdAccessable>
      Returns:
      エンティティの全件リスト。該当なしは空リスト
    • add

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

      public T update(@Valid T entity)
      Description copied from interface: GenericRepository
      エンティティを更新する。
      Specified by:
      update in interface GenericRepository<T extends IdAccessable>
      Parameters:
      entity - 更新内容
      Returns:
      更新後エンティティ。更新対象が存在しない場合はnull
    • delete

      public void delete(T entity)
      Description copied from interface: GenericRepository
      エンティティを削除する。
      Specified by:
      delete in interface GenericRepository<T extends IdAccessable>
      Parameters:
      entity - 削除エンティティ
    • getEntityManage

      protected abstract jakarta.persistence.EntityManager getEntityManage()
    • getTargetClass

      protected abstract Class<T> getTargetClass()