Interface AuthorityRepository

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

public interface AuthorityRepository extends org.springframework.data.jpa.repository.JpaRepository<AuthorityEntity,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<AuthorityEntity>
Author:
im.bytedesk.com
  • Method Details

    • findByUid

      Optional<AuthorityEntity> findByUid(String uid)
    • findByName

      Optional<AuthorityEntity> findByName(String code)
    • findByValue

      Optional<AuthorityEntity> findByValue(String value)
    • existsByValue

      Boolean existsByValue(String value)
    • existsById

      boolean existsById(@NonNull Long id)
      Specified by:
      existsById in interface org.springframework.data.repository.CrudRepository<AuthorityEntity,Long>
    • deleteById

      @Transactional void deleteById(@NonNull Long id)
      Specified by:
      deleteById in interface org.springframework.data.repository.CrudRepository<AuthorityEntity,Long>
    • findByValueContainingIgnoreCaseAndDeletedFalse

      List<AuthorityEntity> findByValueContainingIgnoreCaseAndDeletedFalse(String value)
    • findByDeletedFalse

      List<AuthorityEntity> findByDeletedFalse()
    • resetSettingsAuthoritiesLevelToPlatform

      @Modifying @Transactional @Query(value="UPDATE bytedesk_core_authority SET level_type = \'PLATFORM\' WHERE is_deleted = 0 AND authority_value IS NOT NULL AND authority_value <> \'\' AND authority_value LIKE \'SETTINGS_%\' AND (level_type IS NULL OR level_type <> \'PLATFORM\')", nativeQuery=true) int resetSettingsAuthoritiesLevelToPlatform()
    • resetNonSettingsAuthoritiesLevelToOrganization

      @Modifying @Transactional @Query(value="UPDATE bytedesk_core_authority SET level_type = \'ORGANIZATION\' WHERE is_deleted = 0 AND authority_value IS NOT NULL AND authority_value <> \'\' AND authority_value NOT LIKE \'SETTINGS_%\' AND (level_type IS NULL OR level_type <> \'ORGANIZATION\')", nativeQuery=true) int resetNonSettingsAuthoritiesLevelToOrganization()
    • resetAuthoritiesDescriptionToI18nDescriptionKey

      @Modifying @Transactional @Query(value="UPDATE bytedesk_core_authority SET description = CONCAT(\'i18n.description.\', authority_value) WHERE is_deleted = 0 AND authority_value IS NOT NULL AND authority_value <> \'\' AND (description IS NULL OR description = \'\' OR description LIKE \'Permission for %\' OR description = CONCAT(\'i18n.\', authority_value)) AND (description IS NULL OR description NOT LIKE \'i18n.description.%\')", nativeQuery=true) int resetAuthoritiesDescriptionToI18nDescriptionKey()