Interface RoleRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Role,String>, org.springframework.data.jpa.repository.JpaRepository<Role,String>, org.springframework.data.repository.ListCrudRepository<Role,String>, org.springframework.data.repository.ListPagingAndSortingRepository<Role,String>, org.springframework.data.repository.PagingAndSortingRepository<Role,String>, org.springframework.data.repository.query.QueryByExampleExecutor<Role>, org.springframework.data.repository.Repository<Role,String>, RoleRepositoryCustom

@Repository public interface RoleRepository extends org.springframework.data.jpa.repository.JpaRepository<Role,String>, RoleRepositoryCustom
  • Method Summary

    Modifier and Type
    Method
    Description
    long
     
     
     
    void
    removeNonExistingPrivileges(Set<String> existingPrivileges)
     

    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

    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

    Methods inherited from interface hu.rts.mike.example.dev.crm.repository.RoleRepositoryCustom

    findAllForGrid
  • Method Details

    • findByName

      @EntityGraph(attributePaths="privileges") Optional<Role> findByName(String name)
    • findAll

      @NonNull List<Role> findAll()
      Specified by:
      findAll in interface org.springframework.data.repository.CrudRepository<Role,String>
      Specified by:
      findAll in interface org.springframework.data.repository.ListCrudRepository<Role,String>
    • deleteByName

      long deleteByName(String name)
    • removeNonExistingPrivileges

      @Modifying @Query(value="DELETE FROM role_privileges rp WHERE rp.privilege NOT IN :existing", nativeQuery=true) void removeNonExistingPrivileges(@Param("existing") Set<String> existingPrivileges)