Interface RoleRepository

  • All Superinterfaces:
    org.springframework.data.repository.CrudRepository<Role,​java.lang.Long>, org.springframework.data.repository.Repository<Role,​java.lang.Long>

    public interface RoleRepository
    extends org.springframework.data.repository.CrudRepository<Role,​java.lang.Long>
    CRUD repository connecting Role model to the rest of the application
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Role findByNameIgnoreCase​(java.lang.String name)
      Find a role by name using case insensitive search
      void updateRoleName​(java.lang.String uname, long roleid, java.lang.String name)
      Updates the role name based on the given role id
      • Methods inherited from interface org.springframework.data.repository.CrudRepository

        count, delete, deleteAll, deleteAll, deleteById, existsById, findAll, findAllById, findById, save, saveAll
    • Method Detail

      • findByNameIgnoreCase

        Role findByNameIgnoreCase​(java.lang.String name)
        Find a role by name using case insensitive search
        Parameters:
        name -
        Returns:
        Role object by name
      • updateRoleName

        @Transactional
        @Modifying
        @Query(value="UPDATE roles SET name = :name, lastmodifiedby = :uname, lastmodifieddate = CURRENT_TIMESTAMP WHERE roleid = :roleid",
               nativeQuery=true)
        void updateRoleName​(java.lang.String uname,
                            long roleid,
                            java.lang.String name)
        Updates the role name based on the given role id
        Parameters:
        uname -
        roleid -
        name -