wangwei 7 years ago
parent
commit
cfe23b33d6

+ 8 - 1
examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/entity/Student.java

@@ -3,6 +3,7 @@ package cn.com.qmth.examcloud.core.basic.dao.entity;
 import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
+import javax.persistence.Index;
 import javax.persistence.Table;
 import javax.validation.constraints.NotNull;
 
@@ -12,7 +13,9 @@ import cn.com.qmth.examcloud.commons.web.jpa.JpaEntity;
  * Created by songyue on 17/1/13.
  */
 @Entity
-@Table(name = "ecs_core_student")
+@Table(name = "ecs_core_student", indexes = {
+		@Index(name = "IDX_B_STUDENT_001001", columnList = "rootOrgId,identityNumber", unique = true),
+		@Index(name = "IDX_B_STUDENT_001002", columnList = "rootOrgId,studentCode", unique = true)})
 public class Student extends JpaEntity {
 
 	private static final long serialVersionUID = 757531976286006550L;
@@ -26,20 +29,24 @@ public class Student extends JpaEntity {
 	@NotNull
 	private String name;
 
+	@NotNull
 	private String password;
 
 	private String studentCode;
 
+	@NotNull
 	private String identityNumber;
 
 	private String photoPath;
 
 	private String remark;
 
+	@NotNull
 	private Boolean enable;
 
 	private Long orgId;
 
+	@NotNull
 	private Long rootOrgId;
 
 	/**