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 TypeMethodDescriptionbooleanexistsByCourseAndEmailIgnoreCase(Course course, String email) This method returns whether a course already has a staff member with a given email, ignoring the difference between upper and lower case letters.findAllByEmail(String email) This method returns a CourseStaff entity with a given email.findAllByUser(User user) findByCourseAndGithubLogin(Course course, String githubLogin) findByCourseId(Long courseId) This method returns a list of CourseStaff entities associated with a given course ID.findByEmailAndCourse(String email, Course course) 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, 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
-
findAllByUser
-
findAllByEmail
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
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
This method returns a CourseStaff entity with a given email and course.- Parameters:
email- email address of the course staffcourse- the course associated with the course staff- Returns:
- Optional of CourseStaff (empty if not found)
-
findByCourseAndGithubLogin
-
existsByCourseAndEmailIgnoreCase
This method returns whether a course already has a staff member with a given email, ignoring the difference between upper and lower case letters.- Parameters:
course- the courseemail- email address to look for- Returns:
- true if the course has a staff member with that email in any letter case
-