Interface UserRepository

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

@Repository public interface UserRepository extends org.springframework.data.jpa.repository.JpaRepository<User,UUID>
UserRepository.java - Repository interface for User entity.
Author:
Kristian Popov
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Count users registered after the given moment in time.
    Find user by email.

    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)
      Find user by email.
      Parameters:
      email - - user email
      Returns:
      user
    • countByCreatedOnAfter

      long countByCreatedOnAfter(LocalDateTime createdOn)
      Count users registered after the given moment in time.
      Parameters:
      createdOn - - exclusive lower bound for the registration timestamp
      Returns:
      the number of matching users