package com.qxgmat.data.dao.entity;

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

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

    /**
     * 节点id
     */
    @Column(name = "`struct_id`")
    private Integer structId;

    /**
     * 上级节点id，0为无上级
     */
    @Column(name = "`parent_struct_id`")
    private Integer parentStructId;

    /**
     * 题目模块：base，sentence，textbook
     */
    @Column(name = "`question_module`")
    private String questionModule;

    /**
     * 课程名称
     */
    @Column(name = "`title`")
    private String title;

    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 struct_id - 节点id
     */
    public Integer getStructId() {
        return structId;
    }

    /**
     * 设置节点id
     *
     * @param structId 节点id
     */
    public void setStructId(Integer structId) {
        this.structId = structId;
    }

    /**
     * 获取上级节点id，0为无上级
     *
     * @return parent_struct_id - 上级节点id，0为无上级
     */
    public Integer getParentStructId() {
        return parentStructId;
    }

    /**
     * 设置上级节点id，0为无上级
     *
     * @param parentStructId 上级节点id，0为无上级
     */
    public void setParentStructId(Integer parentStructId) {
        this.parentStructId = parentStructId;
    }

    /**
     * 获取题目模块：base，sentence，textbook
     *
     * @return question_module - 题目模块：base，sentence，textbook
     */
    public String getQuestionModule() {
        return questionModule;
    }

    /**
     * 设置题目模块：base，sentence，textbook
     *
     * @param questionModule 题目模块：base，sentence，textbook
     */
    public void setQuestionModule(String questionModule) {
        this.questionModule = questionModule;
    }

    /**
     * 获取课程名称
     *
     * @return title - 课程名称
     */
    public String getTitle() {
        return title;
    }

    /**
     * 设置课程名称
     *
     * @param title 课程名称
     */
    public void setTitle(String title) {
        this.title = title;
    }

    @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(", structId=").append(structId);
        sb.append(", parentStructId=").append(parentStructId);
        sb.append(", questionModule=").append(questionModule);
        sb.append(", title=").append(title);
        sb.append("]");
        return sb.toString();
    }

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

    public static class Builder {
        private ClassCourse obj;

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

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

        /**
         * 设置节点id
         *
         * @param structId 节点id
         */
        public Builder structId(Integer structId) {
            obj.setStructId(structId);
            return this;
        }

        /**
         * 设置上级节点id，0为无上级
         *
         * @param parentStructId 上级节点id，0为无上级
         */
        public Builder parentStructId(Integer parentStructId) {
            obj.setParentStructId(parentStructId);
            return this;
        }

        /**
         * 设置题目模块：base，sentence，textbook
         *
         * @param questionModule 题目模块：base，sentence，textbook
         */
        public Builder questionModule(String questionModule) {
            obj.setQuestionModule(questionModule);
            return this;
        }

        /**
         * 设置课程名称
         *
         * @param title 课程名称
         */
        public Builder title(String title) {
            obj.setTitle(title);
            return this;
        }

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