|
|
@@ -8,7 +8,10 @@ import javax.validation.constraints.NotNull;
|
|
|
import java.time.OffsetDateTime;
|
|
|
|
|
|
@Entity
|
|
|
-@Table(name = "course")
|
|
|
+@Table(
|
|
|
+ name = "course",
|
|
|
+ indexes = @Index(name = "course_code_index", columnList = "invitationCode")
|
|
|
+)
|
|
|
public class Course {
|
|
|
@Id
|
|
|
@GeneratedValue(strategy = GenerationType.TABLE, generator = "PK_COURSE")
|
|
|
@@ -22,7 +25,7 @@ public class Course {
|
|
|
)
|
|
|
private Long id;
|
|
|
|
|
|
- @Column
|
|
|
+ @Column(unique = true)
|
|
|
@NotNull
|
|
|
private String name;
|
|
|
|
|
|
@@ -50,9 +53,9 @@ public class Course {
|
|
|
@CreationTimestamp
|
|
|
private OffsetDateTime endTime;
|
|
|
|
|
|
- @Column
|
|
|
+ @Column(unique = true)
|
|
|
@NotNull
|
|
|
- private String InvitationCoder;
|
|
|
+ private String invitationCode;
|
|
|
|
|
|
@Column
|
|
|
// @NotNull
|
|
|
@@ -139,12 +142,12 @@ public class Course {
|
|
|
this.endTime = endTime;
|
|
|
}
|
|
|
|
|
|
- public String getInvitationCoder() {
|
|
|
- return InvitationCoder;
|
|
|
+ public String getInvitationCode() {
|
|
|
+ return invitationCode;
|
|
|
}
|
|
|
|
|
|
- public void setInvitationCoder(String invitationCoder) {
|
|
|
- InvitationCoder = invitationCoder;
|
|
|
+ public void setInvitationCode(String invitationCode) {
|
|
|
+ this.invitationCode = invitationCode;
|
|
|
}
|
|
|
|
|
|
public String getMoocUrl() {
|
|
|
@@ -198,7 +201,7 @@ public class Course {
|
|
|
", description='" + description + '\'' +
|
|
|
", startTime=" + startTime +
|
|
|
", endTime=" + endTime +
|
|
|
- ", InvitationCoder='" + InvitationCoder + '\'' +
|
|
|
+ ", InvitationCoder='" + invitationCode + '\'' +
|
|
|
", moocUrl='" + moocUrl + '\'' +
|
|
|
", evalId=" + evalId +
|
|
|
", coderId=" + coderId +
|