Interface StudentRepository

All Known Implementing Classes:
StudentRepositoryImpl

public interface StudentRepository
Repository interface for managing Student entities. Defines methods for CRUD operations and querying students.
  • Method Details

    • save

      Student save(Student student)
      Saves a new student or updates an existing one.
      Parameters:
      student - the student to save
      Returns:
      the saved Student entity
    • findById

      Optional<Student> findById(Long id)
      Retrieves a student by its unique identifier.
      Parameters:
      id - the unique identifier of the student
      Returns:
      an Optional containing the student if found, otherwise empty
    • existsByEmailAndPhoneInOrganization

      boolean existsByEmailAndPhoneInOrganization(Student student)
      Checks whether a student with this email and phone exists in this organization.
      Parameters:
      student - the student to check
      Returns:
      true if a student with the same email and phone exists in this organization, otherwise false
    • findAll

      Page<Student> findAll(int pageNumber, int pageSize)
      Retrieves a paginated list of students.
      Parameters:
      pageNumber - the page number (starting from 0)
      pageSize - the number of students per page
      Returns:
      a Page containing the requested students
    • update

      void update(Student student)
      Updates an existing student.
      Parameters:
      student - the student entity with updated information
    • delete

      void delete(Long id)
      Deletes a student by its unique identifier.
      Parameters:
      id - the unique identifier of the student to delete