package com.ssj.bean.course.domain;

import com.ssj.bean.common.framework.core.domain.BaseEntity;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Entity
@Table(name="tb_course_series_details")
public class CourseSeriesDetail extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * id varchar(36) not null,
    course_unit varchar(100) not null comment '单元',
    course_content varchar(500) not null comment '内容',
    course_model varchar(500) not null comment '模块',
    course_duration varchar(36) not null comment '时长',
    course_num  varchar(10) not null comment '课时',
    create_time datetime comment '创建时间',
    last_update_time datetime comment '最后更新时间',
	 */
	/**
	 * tb_course_series id
	 */
	private String seriesId;
	private String courseUnit;
	private String courseContent;
	private String courseModel;
	private String courseDuration;
	private String courseNum;
	private Date createTime;
	private Date lastUpdateTime;
	private Integer state;
	private Integer courseIndex;
	
	private List<CourseSeriesDetailFile>  fileList = new ArrayList<CourseSeriesDetailFile>();
	
	public String getCourseUnit() {
		return courseUnit;
	}
	public void setCourseUnit(String courseUnit) {
		this.courseUnit = courseUnit;
	}
	public String getCourseContent() {
		return courseContent;
	}
	public void setCourseContent(String courseContent) {
		this.courseContent = courseContent;
	}
	public String getCourseModel() {
		return courseModel;
	}
	public void setCourseModel(String courseModel) {
		this.courseModel = courseModel;
	}
	public String getCourseDuration() {
		return courseDuration;
	}
	public void setCourseDuration(String courseDuration) {
		this.courseDuration = courseDuration;
	}
	public String getCourseNum() {
		return courseNum;
	}
	public void setCourseNum(String courseNum) {
		this.courseNum = courseNum;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public Date getLastUpdateTime() {
		return lastUpdateTime;
	}
	public void setLastUpdateTime(Date lastUpdateTime) {
		this.lastUpdateTime = lastUpdateTime;
	}
	public String getSeriesId() {
		return seriesId;
	}
	public void setSeriesId(String seriesId) {
		this.seriesId = seriesId;
	}
	public Integer getState() {
		return state;
	}
	public void setState(Integer state) {
		this.state = state;
	}
	public Integer getCourseIndex() {
		return courseIndex;
	}
	public void setCourseIndex(Integer courseIndex) {
		this.courseIndex = courseIndex;
	}
	@OneToMany(cascade = { CascadeType.REFRESH}, fetch=FetchType.EAGER)
	@JoinColumn(name="courseDetailsId",updatable =false,insertable =false)
	@OrderBy(" createTime ASC")
	@Fetch(FetchMode.SELECT)
	public List<CourseSeriesDetailFile> getFileList() {
		return fileList;
	}
	public void setFileList(List<CourseSeriesDetailFile> fileList) {
		this.fileList = fileList;
	}
	
	
}
