-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VKT(Backend): Create new ExaminerExamEvent table for exams of good an…
…d satisfactory level. Drop references to examiners from ExamEvent table.
- Loading branch information
Showing
6 changed files
with
125 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
backend/vkt/src/main/java/fi/oph/vkt/model/ExamEventCommon.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package fi.oph.vkt.model; | ||
|
||
import fi.oph.vkt.model.type.ExamLanguage; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
import jakarta.persistence.MappedSuperclass; | ||
import java.time.LocalDate; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@MappedSuperclass | ||
public class ExamEventCommon extends BaseEntity { | ||
|
||
// TODO Is it ok to assume ExaminerExamEvents also have exactly one language? | ||
@Column(name = "language", nullable = false) | ||
@Enumerated(value = EnumType.STRING) | ||
private ExamLanguage language; | ||
|
||
@Column(name = "date", nullable = false) | ||
private LocalDate date; | ||
|
||
@Column(name = "is_hidden", nullable = false) | ||
private boolean isHidden; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
backend/vkt/src/main/java/fi/oph/vkt/model/ExaminerExamEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package fi.oph.vkt.model; | ||
|
||
import jakarta.persistence.*; | ||
import java.time.LocalDateTime; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@Entity | ||
@Table(name = "examiner_exam_event") | ||
public class ExaminerExamEvent extends ExamEventCommon { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "examiner_exam_event_id", nullable = false) | ||
private long id; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "examiner_id", referencedColumnName = "examiner_id") | ||
private Examiner examiner; | ||
|
||
@Column(name = "registration_closes") | ||
private LocalDateTime registrationCloses; | ||
|
||
@Column(name = "max_participants") | ||
private Long maxParticipants; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY, optional = false) | ||
@JoinColumn(name = "municipality_id", referencedColumnName = "municipality_id", nullable = false) | ||
private Municipality municipality; | ||
|
||
@Column(name = "location", nullable = false) | ||
private String location; | ||
//@OneToMany(mappedBy = "examinerExamEvent") | ||
//private List<EnrollmentAppointment> enrollments = new ArrayList<>(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters