Interface CourseStaffRepository

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

public interface CourseStaffRepository extends org.springframework.data.jpa.repository.JpaRepository<CourseStaff,Long>
  • Method Summary

    Modifier and Type
    Method
    Description
    This method returns a CourseStaff entity with a given email.
     
    findByCourseId(Long courseId)
    This method returns a list of CourseStaff entities associated with a given course ID.
    This method returns a CourseStaff entity with a given email and course.

    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

    • findAllByEmail

      List<CourseStaff> findAllByEmail(String email)
      This method returns a CourseStaff entity with a given email.
      Parameters:
      email - email address of the course staff
      Returns:
      List of CourseStaff (empty if not found)
    • findByCourseId

      Iterable<CourseStaff> findByCourseId(Long courseId)
      This method returns a list of CourseStaff entities associated with a given course ID.
      Parameters:
      courseId - ID of the course
      Returns:
      Iterable of CourseStaff (empty if not found)
    • findByEmailAndCourse

      Optional<CourseStaff> findByEmailAndCourse(String email, Course course)
      This method returns a CourseStaff entity with a given email and course.
      Parameters:
      email - email address of the course staff
      course - the course associated with the course staff
      Returns:
      Optional of CourseStaff (empty if not found)
    • findByCourseAndGithubLogin

      Optional<CourseStaff> findByCourseAndGithubLogin(Course course, String githubLogin)