Skip to content

Commit

Permalink
Merge pull request #46 from bcgov/feature/AddRemoveAssessment
Browse files Browse the repository at this point in the history
Feature/add remove assessment
  • Loading branch information
arcshiftsolutions authored Nov 7, 2024
2 parents a174144 + ad7e63e commit 82303cf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ public class AssessmentEntity {
@PastOrPresent
@Column(name = "UPDATE_DATE", nullable = false)
private LocalDateTime updateDate;

}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ public class SessionEntity {

@EqualsAndHashCode.Exclude
@ToString.Exclude
@OneToMany(mappedBy = "sessionEntity", fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true, targetEntity = AssessmentEntity.class)
@OneToMany(mappedBy = "sessionEntity", fetch = FetchType.EAGER, cascade = CascadeType.DETACH, targetEntity = AssessmentEntity.class)
Set<AssessmentEntity> assessments;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
public class AssessmentService {

private final AssessmentRepository assessmentRepository;
private final AssessmentStudentService assessmentStudentService;

@Transactional(propagation = Propagation.REQUIRES_NEW)
public AssessmentEntity updateAssessment(AssessmentEntity assessmentEntity){
Expand Down
3 changes: 3 additions & 0 deletions api/src/main/resources/db/migration/V1.11__EAS.API.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE ASSESSMENT_STUDENT ADD CONSTRAINT assessment_id_fk FOREIGN KEY (ASSESSMENT_ID ) REFERENCES ASSESSMENT (ASSESSMENT_ID);

ALTER TABLE ASSESSMENT ADD CONSTRAINT session_id_fk FOREIGN KEY (SESSION_ID) REFERENCES ASSESSMENT_SESSION (SESSION_ID);

0 comments on commit 82303cf

Please sign in to comment.