Class StudentRepositoryImpl
java.lang.Object
org.example.crmedu.infrastructure.repository.student.StudentRepositoryImpl
- All Implemented Interfaces:
StudentRepository
Implementation of the
StudentRepository
interface. Provides methods for managing Student
entities in the database.-
Constructor Summary
Constructors -
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.
-
Constructor Details
-
StudentRepositoryImpl
public StudentRepositoryImpl()
-
-
Method Details
-
save
Description copied from interface:StudentRepository
Saves a new student or updates an existing one.- Specified by:
save
in interfaceStudentRepository
- Parameters:
student
- the student to save- Returns:
- the saved
Student
entity
-
findById
Description copied from interface:StudentRepository
Retrieves a student by its unique identifier.- Specified by:
findById
in interfaceStudentRepository
- Parameters:
id
- the unique identifier of the student- Returns:
- an
Optional
containing the student if found, otherwise empty
-
existsByEmailAndPhoneInOrganization
Description copied from interface:StudentRepository
Checks whether a student with this email and phone exists in this organization.- Specified by:
existsByEmailAndPhoneInOrganization
in interfaceStudentRepository
- Parameters:
student
- the student to check- Returns:
true
if a student with the same email and phone exists in this organization, otherwisefalse
-
findAll
Description copied from interface:StudentRepository
Retrieves a paginated list of students.- Specified by:
findAll
in interfaceStudentRepository
- Parameters:
pageNumber
- the page number (starting from 0)pageSize
- the number of students per page- Returns:
- a
Page
containing the requested students
-
update
Description copied from interface:StudentRepository
Updates an existing student.- Specified by:
update
in interfaceStudentRepository
- Parameters:
student
- the student entity with updated information
-
delete
Description copied from interface:StudentRepository
Deletes a student by its unique identifier.- Specified by:
delete
in interfaceStudentRepository
- Parameters:
id
- the unique identifier of the student to delete
-