package org.holer.server.model;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;


@Entity
@Table(name = "holer_user")
public class HolerUser
        implements Serializable {
    private static final long serialVersionUID = 6022908930414653660L;
    @Id
    @GeneratedValue
    private Long userId;
    @NotBlank(message = "用户名不能为空")
    @Length(min = 3, max = 128, message = "最小长度为3，最大长度为128")
    private String name;
    @NotBlank(message = "密码不能为空")
    @Length(min = 6, max = 128, message = "最小长度为6，最大长度为128")
    private String password;
    private String token;

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String toString() {
        return "HolerUser(userId=" + getUserId() + ", name=" + getName() + ", password=" + getPassword() + ", token=" + getToken() + ")";
    }


    public Long getUserId() {
        return this.userId;
    }


    public String getName() {
        return this.name;
    }


    public String getPassword() {
        return this.password;
    }


    public String getToken() {
        return this.token;
    }
}
