Interface AuditEventJpaRepositoryBase<T extends AuditEventRecordBase>

Type Parameters:
T - 應用宣告的具體稽核 entity(繼承 AuditEventRecordBase
All Superinterfaces:
org.springframework.data.repository.CrudRepository<T,UUID>, org.springframework.data.jpa.repository.JpaRepository<T,UUID>, org.springframework.data.repository.ListCrudRepository<T,UUID>, org.springframework.data.repository.ListPagingAndSortingRepository<T,UUID>, org.springframework.data.repository.PagingAndSortingRepository<T,UUID>, org.springframework.data.repository.query.QueryByExampleExecutor<T>, org.springframework.data.repository.Repository<T,UUID>

@NoRepositoryBean public interface AuditEventJpaRepositoryBase<T extends AuditEventRecordBase> extends org.springframework.data.jpa.repository.JpaRepository<T,UUID>

稽核事件表 Repository 基底。search 對映 Actuator AuditEventRepository.find (principal / after / type 三參數皆可為 null,null 即不篩該條件)。

ADR-017:jar 不擁有 具體 @Entity,本介面為 @NoRepositoryBean 泛型基底,由應用帶入具體 entity 型參成為可注入 repository。@Query 以 SpEL #{#entityName} 指涉應用的 entity 名。

  • Method Summary

    Modifier and Type
    Method
    Description
    search(String principal, Instant after, String type)
     

    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

    • search

      @Query("SELECT a FROM #{#entityName} a\nWHERE (:principal IS NULL OR a.principal = :principal)\n AND (:after IS NULL OR a.eventAt > :after)\n AND (:type IS NULL OR a.type = :type)\nORDER BY a.eventAt\n") List<T> search(@Param("principal") String principal, @Param("after") Instant after, @Param("type") String type)