package com.qxgmat.data.dao.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

@Table(name = "sentence_code")
public class SentenceCode implements Serializable {
    @Id
    @Column(name = "`id`")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /**
     * 激活code
     */
    @Column(name = "`code`")
    private String code;

    /**
     * 激活用户id
     */
    @Column(name = "`user_id`")
    private Integer userId;

    @Column(name = "`create_time`")
    private Date createTime;

    @Column(name = "`update_time`")
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    /**
     * @return id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取激活code
     *
     * @return code - 激活code
     */
    public String getCode() {
        return code;
    }

    /**
     * 设置激活code
     *
     * @param code 激活code
     */
    public void setCode(String code) {
        this.code = code;
    }

    /**
     * 获取激活用户id
     *
     * @return user_id - 激活用户id
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * 设置激活用户id
     *
     * @param userId 激活用户id
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * @return create_time
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * @param createTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * @return update_time
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * @param updateTime
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @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(", code=").append(code);
        sb.append(", userId=").append(userId);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }

    public static SentenceCode.Builder builder() {
        return new SentenceCode.Builder();
    }

    public static class Builder {
        private SentenceCode obj;

        public Builder() {
            this.obj = new SentenceCode();
        }

        /**
         * @param id
         */
        public Builder id(Integer id) {
            obj.setId(id);
            return this;
        }

        /**
         * 设置激活code
         *
         * @param code 激活code
         */
        public Builder code(String code) {
            obj.setCode(code);
            return this;
        }

        /**
         * 设置激活用户id
         *
         * @param userId 激活用户id
         */
        public Builder userId(Integer userId) {
            obj.setUserId(userId);
            return this;
        }

        /**
         * @param createTime
         */
        public Builder createTime(Date createTime) {
            obj.setCreateTime(createTime);
            return this;
        }

        /**
         * @param updateTime
         */
        public Builder updateTime(Date updateTime) {
            obj.setUpdateTime(updateTime);
            return this;
        }

        public SentenceCode build() {
            return this.obj;
        }
    }
}