wangwei 6 years ago
parent
commit
558363d849

+ 6 - 1
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/CourseGroupEntity.java

@@ -2,9 +2,11 @@ package cn.com.qmth.examcloud.core.examwork.dao.entity;
 
 import java.util.Date;
 
+import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
+import javax.persistence.Index;
 import javax.persistence.Table;
 
 import org.springframework.format.annotation.DateTimeFormat;
@@ -18,7 +20,8 @@ import cn.com.qmth.examcloud.commons.web.jpa.JpaEntity;
  *
  */
 @Entity
-@Table(name = "EC_E_COURSE_GROUP")
+@Table(name = "EC_E_COURSE_GROUP", indexes = {
+		@Index(name = "IDX_E_C_G_001001", columnList = "examId", unique = false)})
 public class CourseGroupEntity extends JpaEntity {
 
 	private static final long serialVersionUID = -3335725218626631530L;
@@ -27,8 +30,10 @@ public class CourseGroupEntity extends JpaEntity {
 	@GeneratedValue
 	private Long id;
 
+	@Column(nullable = false)
 	private Long examId;
 
+	@Column(nullable = false)
 	private String name;
 
 	private String description;

+ 3 - 1
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/CourseGroupRelationEntity.java

@@ -1,5 +1,6 @@
 package cn.com.qmth.examcloud.core.examwork.dao.entity;
 
+import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.Id;
 import javax.persistence.IdClass;
@@ -14,7 +15,7 @@ import cn.com.qmth.examcloud.commons.web.jpa.JpaEntity;
  *
  */
 @Entity
-@Table(name = "ecs_e_course_group_relation")
+@Table(name = "EC_E_COURSE_GROUP_RELATION")
 @IdClass(CourseGroupRelationPK.class)
 public class CourseGroupRelationEntity extends JpaEntity {
 
@@ -26,6 +27,7 @@ public class CourseGroupRelationEntity extends JpaEntity {
 	@Id
 	private Long groupId;
 
+	@Column(nullable = false)
 	private Long examId;
 
 	public Long getCourseId() {

+ 5 - 2
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamEntity.java

@@ -2,6 +2,7 @@ package cn.com.qmth.examcloud.core.examwork.dao.entity;
 
 import java.util.Date;
 
+import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
@@ -9,7 +10,6 @@ import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
 import javax.persistence.Index;
 import javax.persistence.Table;
-import javax.validation.constraints.NotNull;
 
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -33,6 +33,7 @@ public class ExamEntity extends JpaEntity {
 	/**
 	 * 顶级机构Id
 	 */
+	@Column(nullable = false)
 	private Long rootOrgId;
 
 	/**
@@ -50,12 +51,13 @@ public class ExamEntity extends JpaEntity {
 	/**
 	 * 考试名称
 	 */
-	@NotNull
+	@Column(nullable = false)
 	private String name;
 
 	/**
 	 * 考试类型
 	 */
+	@Column(nullable = false)
 	@Enumerated(EnumType.STRING)
 	private ExamType examType;
 
@@ -64,6 +66,7 @@ public class ExamEntity extends JpaEntity {
 	 */
 	private Integer duration;
 
+	@Column(nullable = false)
 	private Boolean enable;
 
 	/**

+ 3 - 0
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamPropertyEntity.java

@@ -1,5 +1,6 @@
 package cn.com.qmth.examcloud.core.examwork.dao.entity;
 
+import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
@@ -30,8 +31,10 @@ public class ExamPropertyEntity extends JpaEntity {
 	/**
 	 * 考试Id
 	 */
+	@Column(nullable = false)
 	private Long examId;
 
+	@Column(nullable = false)
 	private Long keyId;
 
 	@Lob