-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/localVC/support-multiple-SSH-keys
- Loading branch information
Showing
239 changed files
with
4,067 additions
and
2,101 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
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
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
101 changes: 101 additions & 0 deletions
101
src/main/java/de/tum/cit/aet/artemis/atlas/domain/competency/CompetencyExerciseLink.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,101 @@ | ||
package de.tum.cit.aet.artemis.atlas.domain.competency; | ||
|
||
import java.io.Serial; | ||
import java.io.Serializable; | ||
import java.util.Objects; | ||
|
||
import jakarta.persistence.CascadeType; | ||
import jakarta.persistence.Embeddable; | ||
import jakarta.persistence.EmbeddedId; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.MapsId; | ||
import jakarta.persistence.Table; | ||
|
||
import org.hibernate.annotations.Cache; | ||
import org.hibernate.annotations.CacheConcurrencyStrategy; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
|
||
import de.tum.cit.aet.artemis.exercise.domain.Exercise; | ||
|
||
@Entity | ||
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | ||
@Table(name = "competency_exercise") | ||
public class CompetencyExerciseLink extends CompetencyLearningObjectLink { | ||
|
||
@EmbeddedId | ||
@JsonIgnore | ||
protected CompetencyExerciseId id = new CompetencyExerciseId(); | ||
|
||
@ManyToOne(optional = false, cascade = CascadeType.PERSIST) | ||
@MapsId("exerciseId") | ||
private Exercise exercise; | ||
|
||
public CompetencyExerciseLink(CourseCompetency competency, Exercise exercise, double weight) { | ||
super(competency, weight); | ||
this.exercise = exercise; | ||
} | ||
|
||
public CompetencyExerciseLink() { | ||
// Empty constructor for Spring | ||
} | ||
|
||
public Exercise getExercise() { | ||
return exercise; | ||
} | ||
|
||
public void setExercise(Exercise exercise) { | ||
this.exercise = exercise; | ||
} | ||
|
||
public CompetencyExerciseId getId() { | ||
return id; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "CompetencyExerciseLink{" + "exercise=" + exercise + ", id=" + id + ", competency=" + competency + ", weight=" + weight + '}'; | ||
} | ||
|
||
@Embeddable | ||
public static class CompetencyExerciseId implements Serializable { | ||
|
||
@Serial | ||
private static final long serialVersionUID = 1L; | ||
|
||
private long exerciseId; | ||
|
||
private long competencyId; | ||
|
||
public CompetencyExerciseId() { | ||
// Empty constructor for Spring | ||
} | ||
|
||
public CompetencyExerciseId(long exerciseId, long competencyId) { | ||
this.exerciseId = exerciseId; | ||
this.competencyId = competencyId; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (!(o instanceof CompetencyExerciseId that)) { | ||
return false; | ||
} | ||
return exerciseId == that.exerciseId && competencyId == that.competencyId; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(exerciseId, competencyId); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "CompetencyExerciseId{" + "exerciseId=" + exerciseId + ", competencyId=" + competencyId + '}'; | ||
} | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
...ain/java/de/tum/cit/aet/artemis/atlas/domain/competency/CompetencyLearningObjectLink.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,45 @@ | ||
package de.tum.cit.aet.artemis.atlas.domain.competency; | ||
|
||
import java.io.Serializable; | ||
|
||
import jakarta.persistence.CascadeType; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.MappedSuperclass; | ||
import jakarta.persistence.MapsId; | ||
|
||
@MappedSuperclass | ||
public abstract class CompetencyLearningObjectLink implements Serializable { | ||
|
||
@ManyToOne(optional = false, cascade = CascadeType.PERSIST) | ||
@MapsId("competencyId") | ||
protected CourseCompetency competency; | ||
|
||
@Column(name = "link_weight") | ||
protected double weight; | ||
|
||
public CompetencyLearningObjectLink(CourseCompetency competency, double weight) { | ||
this.competency = competency; | ||
this.weight = weight; | ||
} | ||
|
||
public CompetencyLearningObjectLink() { | ||
// Empty constructor for Spring | ||
} | ||
|
||
public CourseCompetency getCompetency() { | ||
return competency; | ||
} | ||
|
||
public void setCompetency(CourseCompetency competency) { | ||
this.competency = competency; | ||
} | ||
|
||
public double getWeight() { | ||
return weight; | ||
} | ||
|
||
public void setWeight(double weight) { | ||
this.weight = weight; | ||
} | ||
} |
101 changes: 101 additions & 0 deletions
101
src/main/java/de/tum/cit/aet/artemis/atlas/domain/competency/CompetencyLectureUnitLink.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,101 @@ | ||
package de.tum.cit.aet.artemis.atlas.domain.competency; | ||
|
||
import java.io.Serial; | ||
import java.io.Serializable; | ||
import java.util.Objects; | ||
|
||
import jakarta.persistence.CascadeType; | ||
import jakarta.persistence.Embeddable; | ||
import jakarta.persistence.EmbeddedId; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.MapsId; | ||
import jakarta.persistence.Table; | ||
|
||
import org.hibernate.annotations.Cache; | ||
import org.hibernate.annotations.CacheConcurrencyStrategy; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
|
||
import de.tum.cit.aet.artemis.lecture.domain.LectureUnit; | ||
|
||
@Entity | ||
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | ||
@Table(name = "competency_lecture_unit") | ||
public class CompetencyLectureUnitLink extends CompetencyLearningObjectLink { | ||
|
||
@EmbeddedId | ||
@JsonIgnore | ||
protected CompetencyLectureUnitId id = new CompetencyLectureUnitId(); | ||
|
||
@ManyToOne(optional = false, cascade = CascadeType.PERSIST) | ||
@MapsId("lectureUnitId") | ||
private LectureUnit lectureUnit; | ||
|
||
public CompetencyLectureUnitLink(CourseCompetency competency, LectureUnit lectureUnit, double weight) { | ||
super(competency, weight); | ||
this.lectureUnit = lectureUnit; | ||
} | ||
|
||
public CompetencyLectureUnitLink() { | ||
// Empty constructor for Spring | ||
} | ||
|
||
public LectureUnit getLectureUnit() { | ||
return lectureUnit; | ||
} | ||
|
||
public void setLectureUnit(LectureUnit lectureUnit) { | ||
this.lectureUnit = lectureUnit; | ||
} | ||
|
||
public CompetencyLectureUnitId getId() { | ||
return id; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "CompetencyLectureUnitLink{" + "lectureUnit=" + lectureUnit + ", id=" + id + ", competency=" + competency + ", weight=" + weight + '}'; | ||
} | ||
|
||
@Embeddable | ||
public static class CompetencyLectureUnitId implements Serializable { | ||
|
||
@Serial | ||
private static final long serialVersionUID = 1L; | ||
|
||
private long lectureUnitId; | ||
|
||
private long competencyId; | ||
|
||
public CompetencyLectureUnitId() { | ||
// Empty constructor for Spring | ||
} | ||
|
||
public CompetencyLectureUnitId(long lectureUnitId, long competencyId) { | ||
this.lectureUnitId = lectureUnitId; | ||
this.competencyId = competencyId; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (!(o instanceof CompetencyLectureUnitId that)) { | ||
return false; | ||
} | ||
return lectureUnitId == that.lectureUnitId && competencyId == that.competencyId; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(lectureUnitId, competencyId); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "CompetencyLectureUnitId{" + "lectureUnitId=" + lectureUnitId + ", competencyId=" + competencyId + '}'; | ||
} | ||
} | ||
} |
Oops, something went wrong.