package com.qxgmat.data.dao.entity;

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

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

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

    /**
     * 科目id：读取struct
     */
    @Column(name = "`category`")
    private Integer category;

    /**
     * 开通时间
     */
    @Column(name = "`start_time`")
    private Date startTime;

    /**
     * 到期时间
     */
    @Column(name = "`expire_time`")
    private Date expireTime;

    private static final long serialVersionUID = 1L;

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

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

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

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

    /**
     * 获取科目id：读取struct
     *
     * @return category - 科目id：读取struct
     */
    public Integer getCategory() {
        return category;
    }

    /**
     * 设置科目id：读取struct
     *
     * @param category 科目id：读取struct
     */
    public void setCategory(Integer category) {
        this.category = category;
    }

    /**
     * 获取开通时间
     *
     * @return start_time - 开通时间
     */
    public Date getStartTime() {
        return startTime;
    }

    /**
     * 设置开通时间
     *
     * @param startTime 开通时间
     */
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    /**
     * 获取到期时间
     *
     * @return expire_time - 到期时间
     */
    public Date getExpireTime() {
        return expireTime;
    }

    /**
     * 设置到期时间
     *
     * @param expireTime 到期时间
     */
    public void setExpireTime(Date expireTime) {
        this.expireTime = expireTime;
    }

    @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(", userId=").append(userId);
        sb.append(", category=").append(category);
        sb.append(", startTime=").append(startTime);
        sb.append(", expireTime=").append(expireTime);
        sb.append("]");
        return sb.toString();
    }

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

    public static class Builder {
        private UserClass obj;

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

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

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

        /**
         * 设置科目id：读取struct
         *
         * @param category 科目id：读取struct
         */
        public Builder category(Integer category) {
            obj.setCategory(category);
            return this;
        }

        /**
         * 设置开通时间
         *
         * @param startTime 开通时间
         */
        public Builder startTime(Date startTime) {
            obj.setStartTime(startTime);
            return this;
        }

        /**
         * 设置到期时间
         *
         * @param expireTime 到期时间
         */
        public Builder expireTime(Date expireTime) {
            obj.setExpireTime(expireTime);
            return this;
        }

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