Class Role

java.lang.Object
com.alpaca.entity.Role

@Entity public class Role extends Object
Represents a Role entity in the system. This entity is mapped to the "roles" table in the database and defines user roles with specific permissions.
  • Field Details

    • id

      private UUID id
      Unique identifier for the Role. This value is automatically generated using a UUID strategy.
    • roleName

      private String roleName
      The name of the Role. This field is unique and cannot be null.
    • roleDescription

      private String roleDescription
      A brief description of the Role. This field is unique and cannot be null.
    • rolePermissions

      private Set<RolePermission> rolePermissions
      Indicates the set of Permission has the Role.

      A Role has a many-to-many relationship with an Permission through RolePermission

    • userRoles

      private Set<UserRole> userRoles
      Indicates the set of User has the Role.

      A Role has a many-to-many relationship with an User through UserRole

  • Constructor Details

    • Role

      public Role(String roleName, String roleDescription, Set<Permission> permissions)
      Constructs an instance of a new Role object with the specified attributes. The generated object is ready to be used and stored in the database.
      Parameters:
      roleName - Name of the Role - must not be null
      roleDescription - Short description of the Role - must not be null
      permissions - Set of permissions associated with this Role
  • Method Details