Class Worker

java.lang.Object
it.univr.passportease.entity.Worker
All Implemented Interfaces:
UserType

@Entity public class Worker extends Object implements UserType
The Worker class is an entity that represents a worker. The worker is the person who is responsible for the management of the offices.
  • Field Details

    • id

      private UUID id
      The id of the Worker.
    • username

      @NonNull private @NonNull String username
      The username of the Worker.
    • email

      @NonNull private @NonNull String email
      The email of the Worker.
    • hashPassword

      @NonNull private @NonNull String hashPassword
      The hash password of the Worker. Known issue: The password is not salted or peppered.
    • refreshToken

      @NonNull private @NonNull String refreshToken
      The refresh token of the Worker. Known issue: The refresh token is stored in plain text, and if the database is compromised, the attacker can impersonate the worker.
    • office

      @NonNull private @NonNull Office office
      The office of the Worker.
    • createdAt

      private Date createdAt
      The Date of creation of the Worker
    • updatedAt

      private Date updatedAt
      The Date of the last update of the Worker
  • Constructor Details

    • Worker

      public Worker()
  • Method Details

    • equals

      public final boolean equals(Object o)
      Equals method for the Worker class.
      Overrides:
      equals in class Object
      Parameters:
      o - The object to compare.
      Returns:
      true if the objects have the same id, false otherwise.
    • hashCode

      public final int hashCode()
      Hash code method for the Worker class.
      Overrides:
      hashCode in class Object
      Returns:
      The hash code of the id.