Interface RedirectsRepository

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

@Repository public interface RedirectsRepository extends org.springframework.data.jpa.repository.JpaRepository<UrlRedirectBean,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<UrlRedirectBean>
Persistence operations for URL redirects, including domain-restricted bulk operations used by redirect cleaning.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor

    org.springframework.data.jpa.repository.JpaSpecificationExecutor.SpecificationFluentQuery<T extends Object>
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Bulk delete for redirect cleaning, restricted to records accessible from the current domain.
    findAllForRedirectCleaning(String domainName, boolean includeUnnamed)
    Loads redirects belonging to the selected domain and optionally redirects from the independent unnamed scope represented by a null or empty domain.
    int
    Bulk update of the target URL for redirect cleaning, restricted to records accessible from the current domain.

    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.jpa.repository.JpaSpecificationExecutor

    count, count, delete, delete, exists, exists, findAll, findAll, findAll, findAll, findAll, findBy, findBy, findOne, findOne, update

    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

    • findAllForRedirectCleaning

      @Query("SELECT redirect FROM UrlRedirectBean redirect WHERE (redirect.domainName = :domainName OR ((:includeUnnamed = true OR :domainName = \'\') AND (redirect.domainName IS NULL OR redirect.domainName = \'\')))") List<UrlRedirectBean> findAllForRedirectCleaning(@Param("domainName") String domainName, @Param("includeUnnamed") boolean includeUnnamed)
      Loads redirects belonging to the selected domain and optionally redirects from the independent unnamed scope represented by a null or empty domain. The cleaning service never combines these scopes during analysis.
      Parameters:
      domainName - normalized selected domain
      includeUnnamed - whether redirects without a domain are included alongside a selected named domain
      Returns:
      redirects accessible from the selected domain
    • updateNewUrlForRedirectCleaning

      @Transactional @Modifying @Query("UPDATE UrlRedirectBean redirect SET redirect.newUrl = :newUrl WHERE redirect.urlRedirectId IN :ids AND (redirect.domainName IS NULL OR redirect.domainName = \'\' OR redirect.domainName = :domainName)") int updateNewUrlForRedirectCleaning(@Param("ids") List<Long> ids, @Param("newUrl") String newUrl, @Param("domainName") String domainName)
      Bulk update of the target URL for redirect cleaning, restricted to records accessible from the current domain. Records with an empty/NULL domain are accessible as the independent unnamed scope; named records must match the selected domain.
      Parameters:
      ids - redirect identifiers to update
      newUrl - new target URL
      domainName - normalized selected domain
      Returns:
      number of updated rows
    • deleteForRedirectCleaning

      @Transactional @Modifying @Query("DELETE FROM UrlRedirectBean redirect WHERE redirect.urlRedirectId IN :ids AND (redirect.domainName IS NULL OR redirect.domainName = \'\' OR redirect.domainName = :domainName)") int deleteForRedirectCleaning(@Param("ids") List<Long> ids, @Param("domainName") String domainName)
      Bulk delete for redirect cleaning, restricted to records accessible from the current domain. Records with an empty/NULL domain are accessible as the independent unnamed scope; named records must match the selected domain.
      Parameters:
      ids - redirect identifiers to delete
      domainName - normalized selected domain
      Returns:
      number of deleted rows