Class RoleService
java.lang.Object
com.needleandstitch.pavuk.service.RoleService
Service layer for managing roles.
This class provides business logic for operations related to roles, such as retrieving, creating, updating, and deleting roles.
Usage:
- Retrieve roles by ID or name
- Create new roles
- Update existing roles
- Delete roles
- Since:
- 15.12.2024
- Version:
- 1.0.0
- Author:
- Needle & Stitch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateRole
(String name) Creates a new role.void
deleteRole
(Long id) Deletes a role by its ID.findAll()
Retrieves all roles.Finds a role by its ID.findByName
(String name) Finds a role by its name.updateRole
(Long id, String name) Updates an existing role.
-
Constructor Details
-
RoleService
public RoleService()
-
-
Method Details
-
findByName
-
findById
-
findAll
-
createRole
-
updateRole
-
deleteRole
Deletes a role by its ID.- Parameters:
id
- The ID of the role to delete- Throws:
jakarta.persistence.EntityNotFoundException
- if the role is not found
-