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 Type
    Method
    Description
    void
    Deletes a tutor by its unique identifier.
    boolean
    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.
    save(Tutor tutor)
    Saves a new tutor or updates an existing one.
    void
    update(Tutor tutor)
    Updates an existing tutor.
  • Method Details

    • save

      Tutor save(Tutor tutor)
      Saves a new tutor or updates an existing one.
      Parameters:
      tutor - the tutor to save
      Returns:
      the saved Tutor entity
    • findById

      Optional<Tutor> findById(Long id)
      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

      Page<Tutor> findAll(int pageNumber, int pageSize)
      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

      boolean existsByUser(Tutor tutor)
      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, otherwise false
    • update

      void update(Tutor tutor)
      Updates an existing tutor.
      Parameters:
      tutor - the tutor entity with updated information
    • delete

      void delete(Long id)
      Deletes a tutor by its unique identifier.
      Parameters:
      id - the unique identifier of the tutor to delete