Service for managing Player entities.
More...
Service for managing Player entities.
Provides retrieval and update operations on players, mapping entities to PlayerDto and validating DTOs with JakartaValidator before and after persistence.
Methods:
-
getPlayer(): retrieves the first selected player with a selected game, read-only transactional.
-
updatePlayer(PlayerDto): updates an existing player, validates input and output DTOs, fully transactional.
Throws NullPointerException for null DTOs, IllegalArgumentException if entities are missing, and jakarta.validation.ConstraintViolationException on validation failures.
◆ PlayerService()
◆ getPlayer()
| PlayerDto fr.softsf.sudokufx.service.business.PlayerService.getPlayer |
( |
| ) |
|
Retrieves and validates the first player with a selected game.
The player must have a non-null selected game and pass all Jakarta Bean Validation constraints.
- Returns
- a validated PlayerDto
- Exceptions
-
| IllegalArgumentException | if no matching player is found |
| ConstraintViolationException | if validation fails on the mapped PlayerDto |
◆ updatePlayer()
| PlayerDto fr.softsf.sudokufx.service.business.PlayerService.updatePlayer |
( |
PlayerDto | dto | ) |
|
Updates an existing player and its associated entities (Game, GameLevel, Grid) in the database based on the provided PlayerDto.
All updates are transactional and validated before and after persistence.
- Parameters
-
| dto | the player data to update; must not be null |
- Returns
- the updated and validated
PlayerDto
- Exceptions
-
| NullPointerException | if dto is null |
| IllegalArgumentException | if any referenced entity does not exist |
| ConstraintViolationException | if validation fails on the DTO |
◆ gameRepository
| final GameRepository fr.softsf.sudokufx.service.business.PlayerService.gameRepository |
|
private |
◆ jakartaValidator
| final JakartaValidator fr.softsf.sudokufx.service.business.PlayerService.jakartaValidator |
|
private |
◆ menuRepository
| final MenuRepository fr.softsf.sudokufx.service.business.PlayerService.menuRepository |
|
private |
◆ optionsRepository
| final OptionsRepository fr.softsf.sudokufx.service.business.PlayerService.optionsRepository |
|
private |
◆ playerLanguageRepository
◆ playerMapper
| final IPlayerMapper fr.softsf.sudokufx.service.business.PlayerService.playerMapper |
|
private |
◆ playerRepository
| final PlayerRepository fr.softsf.sudokufx.service.business.PlayerService.playerRepository |
|
private |
The documentation for this class was generated from the following file: