Class UserRoles

  • All Implemented Interfaces:
    java.io.Serializable

    @Entity
    public class UserRoles
    extends java.lang.Object
    implements java.io.Serializable
    The entity allowing interaction with the userroles table. The join table between users and roles.

    Table enforces a unique constraint of the combination of userid and roleid. These two together form the primary key.

    When you have a compound primary key, you must implement Serializable for Hibernate When you implement Serializable you must implement equals and hash code

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String createdby
      String field containing the username of who created this row
      protected java.util.Date createddate
      Date field containing the date and time when the row was created
      protected java.lang.String lastmodifiedby
      String field containing the username of who last modified this row
      protected java.util.Date lastmodifieddate
      Date field containing the data and time when the row was last modified
    • Constructor Summary

      Constructors 
      Constructor Description
      UserRoles()
      Default constructor used primarily by the JPA.
      UserRoles​(User user, Role role)
      Given the params, create a new user role combination object
    • Field Detail

      • createdby

        protected java.lang.String createdby
        String field containing the username of who created this row
      • createddate

        protected java.util.Date createddate
        Date field containing the date and time when the row was created

        Temporal(TIMESTAMP) - Sets the precision of the date being saved. In this case Date and Time

      • lastmodifiedby

        protected java.lang.String lastmodifiedby
        String field containing the username of who last modified this row
      • lastmodifieddate

        protected java.util.Date lastmodifieddate
        Date field containing the data and time when the row was last modified

        Temporal(TIMESTAMP) - Sets the precision of the date being saved. In this case Date and Time

    • Constructor Detail

      • UserRoles

        public UserRoles()
        Default constructor used primarily by the JPA.
      • UserRoles

        public UserRoles​(User user,
                         Role role)
        Given the params, create a new user role combination object
        Parameters:
        user - The user object of this relationship
        role - The role object of this relationship
    • Method Detail

      • getUser

        public User getUser()
        The getter for User
        Returns:
        the complete user object associated with user role combination
      • setUser

        public void setUser​(User user)
        Setter for user
        Parameters:
        user - change the user object associated with this user role combination to this one.
      • getRole

        public Role getRole()
        Getter for role
        Returns:
        the complete role object associated with this user role combination
      • setRole

        public void setRole​(Role role)
        Setter for role
        Parameters:
        role - change role object associated with this user role combination to this one.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object