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 Summary
Modifier and TypeMethodDescriptionvoid
Deletes a student by its unique identifier.boolean
Checks whether a student with this email and phone exists in this organization.findAll
(int pageNumber, int pageSize) Retrieves a paginated list of students.Retrieves a student by its unique identifier.Saves a new student or updates an existing one.void
Updates an existing student.
-
Method Details
-
save
Saves a new student or updates an existing one.- Parameters:
student
- the student to save- Returns:
- the saved
Student
entity
-
findById
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
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, otherwisefalse
-
findAll
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
Updates an existing student.- Parameters:
student
- the student entity with updated information
-
delete
Deletes a student by its unique identifier.- Parameters:
id
- the unique identifier of the student to delete
-