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 Summary
Modifier and TypeMethodDescriptionCreates a new student.void
deleteStudent
(Long id) Deletes a student by its unique identifier.Retrieves a student by its unique identifier.getStudents
(int pageNumber, int pageSize) Retrieves a paginated list of students.void
updateStudent
(Student student, Long id) Updates an existing student
-
Method Details
-
create
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
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
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
Updates an existing student- Parameters:
student
- the updated student dataid
- the unique identifier of the student to update- Throws:
EntityNotFoundException
- if no student with the given ID is foundEntityExistsException
- if a student with the same email and phone already exists in that organization
-
deleteStudent
Deletes a student by its unique identifier.- Parameters:
id
- the unique identifier of the student to delete
-