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>
Repository for the User entity.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deletes a user by its id.
    boolean
    existsById(@NotNull UUID id)
    Checks if a user with the given fiscal code exists.
    Finds a user by its fiscal code.
    @NotNull Optional<User>
    findById(@NotNull UUID id)
    Finds a user by its id.

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, 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

    • findByFiscalCode

      Optional<User> findByFiscalCode(String fiscalCode)
      Finds a user by its fiscal code.
      Parameters:
      fiscalCode - the fiscal code of the user
      Returns:
      the user with the given fiscal code, as an Optional
    • findById

      @NotNull @NotNull Optional<User> findById(@NotNull @NotNull UUID id)
      Finds a user by its id.
      Specified by:
      findById in interface org.springframework.data.repository.CrudRepository<User,UUID>
      Parameters:
      id - the id of the user
      Returns:
      the user with the given id, as an Optional
    • deleteByFiscalCode

      void deleteByFiscalCode(String fiscalCode)
      Deletes a user by its id.
      Parameters:
      fiscalCode - the fiscal code of the user
    • existsById

      boolean existsById(@NotNull @NotNull UUID id)
      Checks if a user with the given fiscal code exists.
      Specified by:
      existsById in interface org.springframework.data.repository.CrudRepository<User,UUID>
      Parameters:
      id - must not be null. The id of the user
      Returns:
      true if the user with the given id exists, false otherwise