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 TypeMethodDescriptionbooleanexistsByEmail(String email) Checks whether an athlete with the specified email address already exists.findByEmail(String email) 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, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
existsByEmail
Checks whether an athlete with the specified email address already exists.- Parameters:
email- the email address to check- Returns:
trueif an athlete with the email exists,falseotherwise
-
findByUsernameContainingIgnoreCase
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
Finds an athlete by their email address.- Parameters:
email- the email address to search for- Returns:
- an
Optionalcontaining the athlete if found, empty otherwise
-
findById
Finds an athlete by their unique identifier.
-