Interface UserRepository

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

public interface UserRepository extends org.springframework.data.jpa.repository.JpaRepository<AppUser,Long>
Acceso a cuentas persistidas y consultas para validar la unicidad del correo.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Comprueba si el correo ya está registrado.
    boolean
    Comprueba si el correo pertenece a otra cuenta durante una edición.
    Busca una cuenta por su correo normalizado.

    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<AppUser> findByEmail(String email)
      Busca una cuenta por su correo normalizado.
      Parameters:
      email - correo normalizado
      Returns:
      cuenta encontrada, o un resultado vacío
    • existsByEmail

      boolean existsByEmail(String email)
      Comprueba si el correo ya está registrado.
      Parameters:
      email - correo normalizado
      Returns:
      si existe una cuenta con ese correo
    • existsByEmailAndIdNot

      boolean existsByEmailAndIdNot(String email, Long id)
      Comprueba si el correo pertenece a otra cuenta durante una edición.
      Parameters:
      email - correo normalizado
      id - identificador de la cuenta que se está editando
      Returns:
      si otra cuenta ya usa el correo