Interface AthleteRepository

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

@Repository public interface AthleteRepository extends org.springframework.data.jpa.repository.JpaRepository<Athlete,Integer>
Spring Data JPA repository for Athlete entities.

Provides standard CRUD operations as well as custom query methods for retrieving athletes by email, username, and identifier.

Author:
SportTrack Team
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks whether an athlete with the specified email address already exists.
    Finds an athlete by their email address.
    Finds an athlete by their unique identifier.
    Finds all athletes whose username contains the given search string, ignoring case.

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

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

    • existsByEmail

      boolean existsByEmail(String email)
      Checks whether an athlete with the specified email address already exists.
      Parameters:
      email - the email address to check
      Returns:
      true if an athlete with the email exists, false otherwise
    • findByUsernameContainingIgnoreCase

      List<Athlete> findByUsernameContainingIgnoreCase(String q)
      Finds all athletes whose username contains the given search string, ignoring case.
      Parameters:
      q - the search query to match against usernames
      Returns:
      a list of athletes whose usernames contain the query string
    • findByEmail

      Optional<Athlete> findByEmail(String email)
      Finds an athlete by their email address.
      Parameters:
      email - the email address to search for
      Returns:
      an Optional containing the athlete if found, empty otherwise
    • findById

      Optional<Athlete> findById(Integer id)
      Finds an athlete by their unique identifier.
      Specified by:
      findById in interface org.springframework.data.repository.CrudRepository<Athlete,Integer>
      Parameters:
      id - the unique identifier of the athlete
      Returns:
      an Optional containing the athlete if found, empty otherwise