package com.qxgmat.data.dao.entity;

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

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

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

    /**
     * 课程id
     */
    @Column(name = "`course_id`")
    private Integer courseId;

    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
     *
     * @return course_id - 课程id
     */
    public Integer getCourseId() {
        return courseId;
    }

    /**
     * 设置课程id
     *
     * @param courseId 课程id
     */
    public void setCourseId(Integer courseId) {
        this.courseId = courseId;
    }

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

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

    public static class Builder {
        private UserCourse obj;

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

        /**
         * @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
         *
         * @param courseId 课程id
         */
        public Builder courseId(Integer courseId) {
            obj.setCourseId(courseId);
            return this;
        }

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