| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- package com.nju.edu.eval.data.entity;
- import lombok.AllArgsConstructor;
- import lombok.Data;
- import lombok.EqualsAndHashCode;
- import lombok.NoArgsConstructor;
- import javax.persistence.*;
- import java.util.LinkedList;
- import java.util.List;
- /**
- * @author weijin
- */
- @Data
- @Entity
- @EqualsAndHashCode
- @NoArgsConstructor
- @AllArgsConstructor
- @Table(name = "course")
- public class Course {
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- @Column(name = "id")
- private Integer id;
- /**
- * 课程名
- */
- private String name;
- /**
- * 选课码
- */
- private String code;
- /**
- * 课程对应的老师
- */
- private Integer teacherId;
- /**
- * 是否为公开的课程
- */
- private Integer isPublic;
- /**
- * 选课学生
- */
- @ElementCollection
- @CollectionTable(name = "user_course", joinColumns = @JoinColumn(name = "course_id"))
- @Column(name = "user_id")
- private List<Integer> studentIds;
- public Course(String name, String code, Integer teacherId, Integer isPublic) {
- this.name = name;
- this.code = code;
- this.teacherId = teacherId;
- this.isPublic = isPublic;
- }
- }
|