Service for managing Options entities.
More...
Service for managing Options entities.
Provides retrieval and update operations on options, mapping entities to OptionsDto and validating DTOs with JakartaValidator before and after persistence.
Methods:
Throws NullPointerException for null DTOs, IllegalArgumentException if the entity is missing, and jakarta.validation.ConstraintViolationException on validation failures.
◆ OptionsService()
Constructs a new OptionsService with the required database, mapping, and validation dependencies.
- Parameters
-
| optionsRepository | the repository used to access and persist Options entities |
| optionsMapper | the mapper used to convert Options entities to OptionsDto |
| jakartaValidator | the validator used to ensure data integrity of processed DTOs |
◆ duplicateOptions()
| OptionsDto fr.softsf.sudokufx.service.business.OptionsService.duplicateOptions |
( |
Long | optionsId | ) |
|
Duplicates an existing Options entity by creating a new record with a generated ID using the fluent builder.
Fetches the source entity, copies its properties via the builder API, persists it, and validates the resulting DTO before returning.
- Parameters
-
| optionsId | the ID of the Options entity to duplicate; must not be null |
- Returns
- the newly created and validated
OptionsDto
- Exceptions
-
| NullPointerException | if sourceId is null |
| IllegalArgumentException | if the source Options entity does not exist |
| jakarta.validation.ConstraintViolationException | if validation fails on the resulting DTO |
◆ updateOptions()
| OptionsDto fr.softsf.sudokufx.service.business.OptionsService.updateOptions |
( |
OptionsDto | dto | ) |
|
Updates an existing Options entity with the values from the given OptionsDto.
Validates the DTO before applying changes and validates the resulting DTO after saving.
- Parameters
-
| dto | the options data to update; must not be null |
- Returns
- the updated and validated
OptionsDto
- Exceptions
-
| NullPointerException | if dto is null |
| IllegalArgumentException | if the Options entity does not exist |
| jakarta.validation.ConstraintViolationException | if validation fails on the DTO |
◆ jakartaValidator
| final JakartaValidator fr.softsf.sudokufx.service.business.OptionsService.jakartaValidator |
|
private |
◆ optionsMapper
| final IOptionsMapper fr.softsf.sudokufx.service.business.OptionsService.optionsMapper |
|
private |
◆ optionsRepository
| final OptionsRepository fr.softsf.sudokufx.service.business.OptionsService.optionsRepository |
|
private |
The documentation for this class was generated from the following file: