Interface ObjectiveRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Objective,,Integer> org.springframework.data.jpa.repository.JpaRepository<Objective,,Integer> org.springframework.data.repository.ListCrudRepository<Objective,,Integer> org.springframework.data.repository.ListPagingAndSortingRepository<Objective,,Integer> org.springframework.data.repository.PagingAndSortingRepository<Objective,,Integer> org.springframework.data.repository.query.QueryByExampleExecutor<Objective>,org.springframework.data.repository.Repository<Objective,Integer>
@Repository
public interface ObjectiveRepository
extends org.springframework.data.jpa.repository.JpaRepository<Objective,Integer>
Spring Data JPA repository for
Objective entities.
Provides standard CRUD operations as well as custom query methods for retrieving objectives by athlete.
- Author:
- SportTrack Team
-
Method Summary
Modifier and TypeMethodDescriptionfindByAthlete(Athlete athlete) Finds all objectives belonging to the specified athlete.findByIdAndAthlete_Id(int id, Integer athleteId) Finds an objective by its identifier and the identifier of the owning athlete.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, 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
-
findByAthlete
Finds all objectives belonging to the specified athlete.- Parameters:
athlete- the athlete whose objectives should be retrieved- Returns:
- an iterable of objectives owned by the athlete
-
findByIdAndAthlete_Id
Finds an objective by its identifier and the identifier of the owning athlete.- Parameters:
id- the unique identifier of the objectiveathleteId- the identifier of the athlete who owns the objective- Returns:
- an
Optionalcontaining the objective if found, empty otherwise
-