Przeglądaj źródła

数据库字段调整

deason 6 lat temu
rodzic
commit
a085943384

+ 16 - 17
examcloud-core-print-dao/src/main/java/cn/com/qmth/examcloud/core/print/entity/CourseStatistic.java

@@ -9,10 +9,7 @@ package cn.com.qmth.examcloud.core.print.entity;
 
 import cn.com.qmth.examcloud.core.print.common.IdEntity;
 
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Index;
-import javax.persistence.Table;
+import javax.persistence.*;
 
 /**
  * 课程统计信息
@@ -49,11 +46,6 @@ public class CourseStatistic extends IdEntity {
      */
     @Column(length = 50)
     private String paperType;
-    /**
-     * 绑定的课程试卷ID
-     * (表ec_prt_course_paper的ID)
-     */
-    private Long coursePaperId;
     /**
      * @See PaperBindingStatus.java
      * 试卷绑定状态
@@ -63,6 +55,21 @@ public class CourseStatistic extends IdEntity {
      * 考生人数
      */
     private Integer totalStudent;
+    /**
+     * 绑定的课程试卷ID
+     * (表ec_prt_course_paper的ID)
+     */
+    @OneToOne(cascade = CascadeType.DETACH, fetch = FetchType.EAGER)
+    @JoinColumn(name = "course_paper_id")
+    private CoursePaper coursePaper;
+
+    public CoursePaper getCoursePaper() {
+        return coursePaper;
+    }
+
+    public void setCoursePaper(CoursePaper coursePaper) {
+        this.coursePaper = coursePaper;
+    }
 
     public Long getOrgId() {
         return orgId;
@@ -112,14 +119,6 @@ public class CourseStatistic extends IdEntity {
         this.paperType = paperType;
     }
 
-    public Long getCoursePaperId() {
-        return coursePaperId;
-    }
-
-    public void setCoursePaperId(Long coursePaperId) {
-        this.coursePaperId = coursePaperId;
-    }
-
     public Integer getPaperBindingStatus() {
         return paperBindingStatus;
     }