content: package priv.jesse.mall.entity;
  
  import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.Id;
  import java.io.Serializable;
  
  @Entity
  public class User implements Serializable {
      @Id
      @GeneratedValue
      @Column
      private Integer id;
      /**
       * 用户名
       */
      @Column
      private String username;
      /**
       * 密码
       */
      @Column
      private String password;
      /**
       * 姓名
       */
      @Column
      private String name;
      /**
       * 邮件
       */
      @Column
      private String email;
      /**
       * 电话
       */
      @Column
      private String phone;
      /**
       * 地址
       */
      @Column
      private String addr;
  
      private static final long serialVersionUID = 1L;
  
      public User(Integer id, String username, String password, String name, String email, String phone, String addr, String code, Integer state) {
          this.id = id;
          this.username = username;
          this.password = password;
          this.name = name;
          this.email = email;
          this.phone = phone;
          this.addr = addr;
      }
  
      public User() {
          super();
      }
  
      public Integer getId() {
          return id;
      }
  
      public void setId(Integer id) {
          this.id = id;
      }
  
      public String getUsername() {
          return username;
      }
  
      public void setUsername(String username) {
          this.username = username == null ? null : username.trim();
      }
  
      public String getPassword() {
          return password;
      }
  
      public void setPassword(String password) {
          this.password = password == null ? null : password.trim();
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name == null ? null : name.trim();
      }
  
      public String getEmail() {
          return email;
      }
  
      public void setEmail(String email) {
          this.email = email == null ? null : email.trim();
      }
  
      public String getPhone() {
          return phone;
      }
  
      public void setPhone(String phone) {
          this.phone = phone == null ? null : phone.trim();
      }
  
      public String getAddr() {
          return addr;
      }
  
      public void setAddr(String addr) {
          this.addr = addr == null ? null : addr.trim();
      }
  
  
      @Override
      public boolean equals(Object that) {
          if (this == that) {
              return true;
          }
          if (that == null) {
              return false;
          }
          if (getClass() != that.getClass()) {
              return false;
          }
          User other = (User) that;
          return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                  && (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()))
                  && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
                  && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
                  && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
                  && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
                  && (this.getAddr() == null ? other.getAddr() == null : this.getAddr().equals(other.getAddr()));
      }
  
      @Override
      public int hashCode() {
          final int prime = 31;
          int result = 1;
          result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
          result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
          result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
          result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
          result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
          result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
          result = prime * result + ((getAddr() == null) ? 0 : getAddr().hashCode());
          return result;
      }
  
      @Override
      public String toString() {
          StringBuilder sb = new StringBuilder();
          sb.append(getClass().getSimpleName());
          sb.append(" [");
          sb.append("Hash = ").append(hashCode());
          sb.append(", id=").append(id);
          sb.append(", username=").append(username);
          sb.append(", password=").append(password);
          sb.append(", name=").append(name);
          sb.append(", email=").append(email);
          sb.append(", phone=").append(phone);
          sb.append(", addr=").append(addr);
          sb.append(", serialVersionUID=").append(serialVersionUID);
          sb.append("]");
          return sb.toString();
      }
  }