Interface UserRepository

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

@Repository public interface UserRepository extends org.springframework.data.jpa.repository.JpaRepository<User,Long>
The UserRepository is a repository for User entities.
  • Method Summary

    Modifier and Type
    Method
    Description
    This method returns a User entity with an alias.
    This method returns a User entity with a given email.
    This method returns a list of users with proposed alias that is not null.
     

    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

    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

    • findByEmail

      Optional<User> findByEmail(String email)
      This method returns a User entity with a given email.
      Parameters:
      email - email address of the user
      Returns:
      Optional of User (empty if not found)
    • findByAlias

      Optional<User> findByAlias(String alias)
      This method returns a User entity with an alias.
      Parameters:
      alias - alias of the user
      Returns:
      Optional of User (empty if not found)
    • findByProposedAliasNotNull

      List<User> findByProposedAliasNotNull()
      This method returns a list of users with proposed alias that is not null.
    • findByStatusAndProposedAliasNotNull

      List<User> findByStatusAndProposedAliasNotNull(ModerationStatus status)