Interface StudentService

All Known Implementing Classes:
StudentServiceImpl

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

    • create

      Student create(Student student)
      Creates a new student.
      Parameters:
      student - the student to create
      Returns:
      the created Student
      Throws:
      EntityExistsException - if a student with the same email and phone exists in certain organization
    • findById

      Student findById(Long id)
      Retrieves a student by its unique identifier.
      Parameters:
      id - the unique identifier of the student
      Returns:
      the found Student
      Throws:
      EntityNotFoundException - if no student with the given ID is found
    • getStudents

      Page<Student> getStudents(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
    • updateStudent

      void updateStudent(Student student, Long id)
      Updates an existing student
      Parameters:
      student - the updated student data
      id - the unique identifier of the student to update
      Throws:
      EntityNotFoundException - if no student with the given ID is found
      EntityExistsException - if a student with the same email and phone already exists in that organization
    • deleteStudent

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