Interface SubjectService

All Known Implementing Classes:
SubjectServiceImpl

public interface SubjectService
Service interface for managing Subject entities. Defines methods for CRUD operations and querying subjects.
  • Method Summary

    Modifier and Type
    Method
    Description
    create(Subject subject)
    Creates a new subject.
    void
    Deletes a subject by its unique identifier.
    findAll(int pageNumber, int pageSize)
    Retrieves a paginated list of subjects.
    Retrieves a subject by its unique identifier.
    void
    update(Subject subject, Long id)
    Updates an existing subject
  • Method Details

    • create

      Subject create(Subject subject)
      Creates a new subject.
      Parameters:
      subject - the subject to create
      Returns:
      the created Subject
      Throws:
      EntityExistsException - if a subject with the same name already exists or if an organization, which subject belongs, not exist
    • findById

      Subject findById(Long id)
      Retrieves a subject by its unique identifier.
      Parameters:
      id - the unique identifier of the subject
      Returns:
      the found Subject
      Throws:
      EntityNotFoundException - if no subject with the given ID is found
    • findAll

      Page<Subject> findAll(int pageNumber, int pageSize)
      Retrieves a paginated list of subjects.
      Parameters:
      pageNumber - the page number (starting from 0)
      pageSize - the number of subjects per page
      Returns:
      a Page containing the requested subjects
    • update

      void update(Subject subject, Long id)
      Updates an existing subject
      Parameters:
      subject - the updated subject data
      id - the unique identifier of the subject to update
      Throws:
      EntityNotFoundException - if no subject with the given ID is found or if an organization, which subject belongs, not exist
      EntityExistsException - if a subject with the same name already exists
    • delete

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