generated from MEITREX/template_microservice
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
200 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
...nistuttgart/iste/meitrex/assignment_service/persistence/entity/ExerciseGradingEntity.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,42 @@ | ||
package de.unistuttgart.iste.meitrex.assignment_service.persistence.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
import java.io.Serializable; | ||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
@Entity(name = "ExerciseGrading") | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ExerciseGradingEntity { | ||
|
||
@EmbeddedId | ||
private PrimaryKey primaryKey; | ||
|
||
@Column(nullable = false) | ||
private double achievedCredits; | ||
|
||
@Column(nullable = false) | ||
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, mappedBy = "parentExerciseGrading") | ||
private List<SubexerciseGradingEntity> subexerciseGradings; | ||
|
||
@ManyToOne | ||
@EqualsAndHashCode.Exclude | ||
@ToString.Exclude | ||
private GradingEntity parentGrading; | ||
|
||
@Data | ||
@Embeddable | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public static class PrimaryKey implements Serializable { | ||
private UUID assessmentId; | ||
private UUID userId; | ||
|
||
} | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
...ava/de/unistuttgart/iste/meitrex/assignment_service/persistence/entity/GradingEntity.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,46 @@ | ||
package de.unistuttgart.iste.meitrex.assignment_service.persistence.entity; | ||
|
||
|
||
import de.unistuttgart.iste.meitrex.generated.dto.ExerciseGrading; | ||
import jakarta.persistence.*; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.io.Serializable; | ||
import java.time.OffsetDateTime; | ||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
@Entity(name = "Grading") | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class GradingEntity { | ||
|
||
@EmbeddedId | ||
private PrimaryKey primaryKey; | ||
|
||
@Column(nullable = false) | ||
private OffsetDateTime date; | ||
|
||
@Column(nullable = false) | ||
private double achievedCredits; | ||
|
||
@Column(nullable = false) | ||
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, mappedBy = "parentGrading") | ||
private List<ExerciseGradingEntity> exerciseGradings; | ||
|
||
@Data | ||
@Embeddable | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public static class PrimaryKey implements Serializable { | ||
private UUID assessmentId; | ||
private UUID userId; | ||
|
||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
...tuttgart/iste/meitrex/assignment_service/persistence/entity/SubexerciseGradingEntity.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,36 @@ | ||
package de.unistuttgart.iste.meitrex.assignment_service.persistence.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
import java.io.Serializable; | ||
import java.util.UUID; | ||
|
||
@Entity(name = "SubexerciseGrading") | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class SubexerciseGradingEntity { | ||
|
||
@EmbeddedId | ||
private PrimaryKey primaryKey; | ||
|
||
@Column(nullable = false) | ||
private double achievedCredits; | ||
|
||
@ManyToOne | ||
@EqualsAndHashCode.Exclude | ||
@ToString.Exclude | ||
private GradingEntity parentExerciseGrading; | ||
|
||
@Data | ||
@Embeddable | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public static class PrimaryKey implements Serializable { | ||
private UUID assessmentId; | ||
private UUID userId; | ||
|
||
} | ||
} |
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,68 @@ | ||
""" | ||
A grading contains a user's achieved credits on an assignment and its exercises and subexercises. | ||
""" | ||
type Grading { | ||
""" | ||
ID of the assignment. | ||
""" | ||
assessmentId: UUID! | ||
|
||
""" | ||
ID of the user the grading belongs to. | ||
""" | ||
userId: UUID! | ||
|
||
""" | ||
The date and time of when the tutor corrected the assignment. | ||
""" | ||
date: DateTime! | ||
|
||
""" | ||
The absolute number of achieved credits on the assignment. | ||
""" | ||
achievedCredits: Float! | ||
|
||
""" | ||
List of exercise-gradings for each exercise in the assignment. Can be empty, if there are no exercises within the assignment. | ||
""" | ||
exerciseGradings: [ExerciseGrading]! | ||
} | ||
|
||
type ExerciseGrading { | ||
""" | ||
ID of the exercise. | ||
""" | ||
itemId: UUID! | ||
|
||
""" | ||
ID of the user the exercise-grading belongs to. | ||
""" | ||
userId: UUID! | ||
|
||
""" | ||
The absolute number of achieved credits on the exercise. | ||
""" | ||
achievedCredits: Float! | ||
|
||
""" | ||
List of subexercise-gradings for each subexercise in the exercise. Can be empty, if there are no subexercises within the exercise. | ||
""" | ||
subexerciseGradings: [SubexerciseGrading]! | ||
} | ||
|
||
type SubexerciseGrading { | ||
""" | ||
ID of the subexercise. | ||
""" | ||
itemId: UUID! | ||
|
||
""" | ||
ID of the user the subexercise-grading belongs to. | ||
""" | ||
userId: UUID! | ||
|
||
""" | ||
The absolute number of achieved credits on the subexercise. | ||
""" | ||
achievedCredits: Float! | ||
} |
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