Class TutorServiceImpl

java.lang.Object
org.example.crmedu.domain.service.tutor.TutorServiceImpl
All Implemented Interfaces:
TutorService

@Service public class TutorServiceImpl extends Object implements TutorService
Implementation of the TutorService interface. Provides business logic for managing Tutor entities.
  • Constructor Details

    • TutorServiceImpl

      public TutorServiceImpl()
  • Method Details

    • create

      public Tutor create(Tutor tutor)
      Description copied from interface: TutorService
      Creates a new tutor.
      Specified by:
      create in interface TutorService
      Parameters:
      tutor - the tutor to create
      Returns:
      the created Tutor
    • findById

      @Transactional(readOnly=true) public Tutor findById(Long id)
      Description copied from interface: TutorService
      Retrieves an tutor by its unique identifier.
      Specified by:
      findById in interface TutorService
      Parameters:
      id - the unique identifier of the tutor
      Returns:
      the found Tutor
    • findAll

      public Page<Tutor> findAll(int pageNumber, int pageSize)
      Description copied from interface: TutorService
      Retrieves a paginated list of tutors.
      Specified by:
      findAll in interface TutorService
      Parameters:
      pageNumber - the page number (starting from 0)
      pageSize - the number of tutors per page
      Returns:
      a Page containing the requested tutors
    • update

      @Transactional public void update(Tutor tutor, Long id)
      Description copied from interface: TutorService
      Updates an existing tutor.
      Specified by:
      update in interface TutorService
      Parameters:
      tutor - the updated tutor data
      id - the unique identifier of the tutor to update
    • delete

      public void delete(Long id)
      Description copied from interface: TutorService
      Deletes a tutor by its unique identifier.
      Specified by:
      delete in interface TutorService
      Parameters:
      id - the unique identifier of the tutor to delete
    • patchSubjects

      @Transactional public void patchSubjects(Set<Subject> subjects, Long id)
      Description copied from interface: TutorService
      Updates the list of subjects that a tutor can teach.
      Specified by:
      patchSubjects in interface TutorService
      Parameters:
      subjects - set of subjects
      id - the unique identifier of the tutor to update
    • patchGrades

      @Transactional public void patchGrades(Set<Integer> grades, Long id)
      Description copied from interface: TutorService
      Updates the list of education classes that a tutor can teach.
      Specified by:
      patchGrades in interface TutorService
      Parameters:
      grades - set of grades
      id - the unique identifier of the tutor to update