Interface RoleRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Role,​java.lang.Long>, org.springframework.data.jpa.repository.JpaRepository<Role,​java.lang.Long>, org.springframework.data.repository.PagingAndSortingRepository<Role,​java.lang.Long>, org.springframework.data.repository.query.QueryByExampleExecutor<Role>, org.springframework.data.repository.Repository<Role,​java.lang.Long>

public interface RoleRepository
extends org.springframework.data.jpa.repository.JpaRepository<Role,​java.lang.Long>

Role Repository

Interface that manages the queries executed by the program to get information from the database about the role table.

  • Method Summary

    Modifier and Type Method Description
    java.util.Optional<Role> findByName​(java.lang.String name)
    FIND BY NAME

    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, findAll, findAll, findAllById, flush, getById, getOne, saveAll, saveAllAndFlush, saveAndFlush

    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

    • findByName

      java.util.Optional<Role> findByName​(java.lang.String name)

      FIND BY NAME

      Search a role in the database using it's name. All roles in the database are unique, so it will only get a maximum of one role.

      Parameters:
      name - Name of the role that is going to be looked for.
      Returns:
      Optional value, if the user email was found will return the role.