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 TypeMethodDescriptionCreates 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
Updates an existing subject
-
Method Details
-
create
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
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
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
Updates an existing subject- Parameters:
subject
- the updated subject dataid
- 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 existEntityExistsException
- if a subject with the same name already exists
-
delete
Deletes a subject by its unique identifier.- Parameters:
id
- the unique identifier of the subject to delete
-