Interface NotificationTemplateRepositoryBase<T extends NotificationTemplateBase>

Type Parameters:
T - 應用宣告的具體範本 entity(繼承 NotificationTemplateBase
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 NotificationTemplateRepositoryBase<T extends NotificationTemplateBase> extends org.springframework.data.jpa.repository.JpaRepository<T,UUID>

通知範本資料存取基底

ADR-017:jar 不擁有 具體 @Entity,本介面為 @NoRepositoryBean 泛型基底,由應用帶入具體 entity 型參成為可注入 repository (租戶覆寫表與全域表各一個 repository,共用本基底)。

查詢不帶 tenantId(決策三):租戶覆寫表的 entity 帶 @TenantId,Hibernate 於 Session 建構時 自動加租戶條件;全域表無租戶欄位、天然全域。舊版的四支 IsNull 衍生查詢(tenant / global × locale / 不分語系)收斂為單一查詢——「哪張表」由 repository 實例決定、「不分語系」以 NotificationTemplateBase.ANY_LOCALE 哨兵值查詢(locale NOT NULL,決策五)。

Since:
4.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    查某型別×通道×語系的啟用範本;「不分語系」以 NotificationTemplateBase.ANY_LOCALE 查詢, 租戶範圍(若為租戶覆寫表)由 @TenantId filter 自動限縮

    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

    • findByTypeAndChannelAndLocaleAndEnabledTrue

      Optional<T> findByTypeAndChannelAndLocaleAndEnabledTrue(String type, ChannelType channel, String locale)
      查某型別×通道×語系的啟用範本;「不分語系」以 NotificationTemplateBase.ANY_LOCALE 查詢, 租戶範圍(若為租戶覆寫表)由 @TenantId filter 自動限縮