Interface StudentRepository

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

@Repository public interface StudentRepository extends org.springframework.data.jpa.repository.JpaRepository<Student,Long>
The repository containing the students in the application.
  • Method Summary

    Modifier and Type
    Method
    Description
    Fetches a student by the first name and last name.
    Fetches a student by the passport number.

    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

    • findStudentByPassportNumber

      Optional<Student> findStudentByPassportNumber(String passportNumber)
      Fetches a student by the passport number.
      Parameters:
      passportNumber - The students passport number.
      Returns:
      The found student.
    • findStudentByFirstNameAndLastName

      Optional<Student> findStudentByFirstNameAndLastName(String firstName, String lastName)
      Fetches a student by the first name and last name.
      Parameters:
      firstName - The first name of the student.
      lastName - The last name of the student.
      Returns:
      The found student.