package com.qxgmat.data.dao.entity;

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

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

    @Column(name = "`module`")
    private Integer module;

    @Column(name = "`module_id`")
    private Integer moduleId;

    private static final long serialVersionUID = 1L;

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

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

    /**
     * @return module
     */
    public Integer getModule() {
        return module;
    }

    /**
     * @param module
     */
    public void setModule(Integer module) {
        this.module = module;
    }

    /**
     * @return module_id
     */
    public Integer getModuleId() {
        return moduleId;
    }

    /**
     * @param moduleId
     */
    public void setModuleId(Integer moduleId) {
        this.moduleId = moduleId;
    }

    @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(", module=").append(module);
        sb.append(", moduleId=").append(moduleId);
        sb.append("]");
        return sb.toString();
    }

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

    public static class Builder {
        private Article obj;

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

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

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

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

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