Package com.myhrcrmproject.service
Interface CommonService<Q,R>
- Type Parameters:
Q- The type of the request DTO.R- The type of the response DTO.
- All Known Implementing Classes:
CandidateService,ClientService,CommunicationService,CompensationService,ContractService,EmployeeService,InterviewService,TaskService,UserDetailsServiceImpl,VacancyService
public interface CommonService<Q,R>
Generic interface for common CRUD (Create, Read, Update, Delete) operations in a service layer.
This interface defines standard methods for performing CRUD operations on entities. Implementing services should provide concrete implementations for these methods based on the specific requirements of the entities they manage.
The type parameters Q and R represent the request and response DTO types, respectively.
- Version:
- 1.0
- Author:
- Denys Chaykovskyy
-
Method Summary
Modifier and TypeMethodDescriptionCreates a new entity based on the provided data.voidDeletes an entity by its unique identifier.findAll()Retrieves a list of all entities.Retrieves an entity by its unique identifier.Updates an existing entity with new data.
-
Method Details
-
findAll
Retrieves a list of all entities.- Returns:
- A list of response DTOs representing all entities.
-
findById
Retrieves an entity by its unique identifier.- Parameters:
id- The identifier of the entity to retrieve.- Returns:
- The response DTO representing the retrieved entity.
-
create
Creates a new entity based on the provided data.- Parameters:
requestDTO- The request DTO containing data for the new entity.- Returns:
- The response DTO representing the newly created entity.
-
update
Updates an existing entity with new data.- Parameters:
id- The identifier of the entity to update.requestDTO- The request DTO containing updated data for the entity.- Returns:
- The response DTO representing the updated entity.
-
delete
Deletes an entity by its unique identifier.- Parameters:
id- The identifier of the entity to delete.
-