Class TutorScheduleRepositoryImpl
java.lang.Object
org.example.crmedu.infrastructure.repository.schedule.TutorScheduleRepositoryImpl
- All Implemented Interfaces:
TutorScheduleRepository
@Component
public class TutorScheduleRepositoryImpl
extends Object
implements TutorScheduleRepository
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deletes a schedule by its unique identifier.Retrieves a tutor schedule by its unique identifier.findByTutorId
(Long tutorId) Retrieves a set of schedules of certain tutor.findPagesByTutorId
(int pageNumber, int pageSize, Long tutorId) Retrieves a paginated list of schedules of certain tutor.save
(TutorSchedule schedule) Saves a new tutor schedule or updates an existing one.void
update
(TutorSchedule schedule) Updates an existing schedule.
-
Constructor Details
-
TutorScheduleRepositoryImpl
public TutorScheduleRepositoryImpl()
-
-
Method Details
-
save
Description copied from interface:TutorScheduleRepository
Saves a new tutor schedule or updates an existing one.- Specified by:
save
in interfaceTutorScheduleRepository
- Parameters:
schedule
- the schedule to save- Returns:
- the saved
TutorSchedule
entity
-
findById
Description copied from interface:TutorScheduleRepository
Retrieves a tutor schedule by its unique identifier.- Specified by:
findById
in interfaceTutorScheduleRepository
- Parameters:
id
- the unique identifier of the tutor schedule- Returns:
- an
Optional
containing the tutor schedule if found, otherwise empty
-
findPagesByTutorId
Description copied from interface:TutorScheduleRepository
Retrieves a paginated list of schedules of certain tutor.- Specified by:
findPagesByTutorId
in interfaceTutorScheduleRepository
- Parameters:
pageNumber
- pageNumber the page number (starting from 0)pageSize
- the number of tutors per pagetutorId
- the unique identifier of the tutor.- Returns:
- a
Page
containing the requested schedules
-
findByTutorId
Description copied from interface:TutorScheduleRepository
Retrieves a set of schedules of certain tutor.- Specified by:
findByTutorId
in interfaceTutorScheduleRepository
- Parameters:
tutorId
- the unique identifier of tutor- Returns:
- the
Set<TutorSchedule>
containing the requested schedules
-
update
Description copied from interface:TutorScheduleRepository
Updates an existing schedule.- Specified by:
update
in interfaceTutorScheduleRepository
- Parameters:
schedule
- the schedule with updated information.
-
delete
Description copied from interface:TutorScheduleRepository
Deletes a schedule by its unique identifier.- Specified by:
delete
in interfaceTutorScheduleRepository
- Parameters:
id
- the unique identifier of the schedule to delete
-