Interface TutorRepository
- All Known Implementing Classes:
TutorRepositoryImpl
public interface TutorRepository
Repository interface for managing
Tutor
entities. Defines methods for CRUD operations and querying tutors.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Deletes a tutor by its unique identifier.boolean
existsByUser
(Tutor tutor) Checks whether a tutor with the same user already exists.findAll
(int pageNumber, int pageSize) Retrieves a paginated list of tutors.Retrieves a tutor by its unique identifier.Saves a new tutor or updates an existing one.void
Updates an existing tutor.
-
Method Details
-
save
Saves a new tutor or updates an existing one.- Parameters:
tutor
- the tutor to save- Returns:
- the saved
Tutor
entity
-
findById
Retrieves a tutor by its unique identifier.- Parameters:
id
- the unique identifier of the tutor- Returns:
- an
Optional
containing the tutor if found, otherwise empty
-
findAll
Retrieves a paginated list of tutors.- Parameters:
pageNumber
- the page number (starting from 0)pageSize
- the number of tutors per page- Returns:
- a
Page
containing the requested tutors
-
existsByUser
Checks whether a tutor with the same user already exists.- Parameters:
tutor
- the tutor to check- Returns:
true
if a tutor with the same user exists, otherwisefalse
-
update
Updates an existing tutor.- Parameters:
tutor
- the tutor entity with updated information
-
delete
Deletes a tutor by its unique identifier.- Parameters:
id
- the unique identifier of the tutor to delete
-