Class UserRole

java.lang.Object
com.alpaca.entity.UserRole

@Entity public class UserRole extends Object
Represents the association between a User and a Role.

This entity defines a many-to-many relationship between users and roles and is mapped to the "user_roles" table in the database.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private UUID
    Unique identifier for the UserRole association.
    private Role
    The Role associated with this UserRole.
    private User
    The User associated with this UserRole.
  • Constructor Summary

    Constructors
    Constructor
    Description
    UserRole(User user, Role role)
    Constructs an instance of a new UserRole object with the specified attributes.
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • id

      private UUID id
      Unique identifier for the UserRole association. This value is automatically generated using a UUID strategy.
    • user

      private User user
      The User associated with this UserRole. This field cannot be null.
    • role

      private Role role
      The Role associated with this UserRole. This field cannot be null.
  • Constructor Details

    • UserRole

      public UserRole(User user, Role role)
      Constructs an instance of a new UserRole object with the specified attributes.
      Parameters:
      user - the User associated with this UserRole - must not be null
      role - the Role associated with this UserRole - must not be null