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 Type
    Method
    Description
    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, 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

    • findByAthlete

      Iterable<Objective> findByAthlete(Athlete athlete)
      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

      Optional<Objective> findByIdAndAthlete_Id(int id, Integer athleteId)
      Finds an objective by its identifier and the identifier of the owning athlete.
      Parameters:
      id - the unique identifier of the objective
      athleteId - the identifier of the athlete who owns the objective
      Returns:
      an Optional containing the objective if found, empty otherwise