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
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
...unistuttgart/iste/meitrex/assignment_service/persistence/entity/StudentMappingEntity.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 de.unistuttgart.iste.meitrex.common.persistence.IWithId; | ||
import jakarta.persistence.*; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.io.Serializable; | ||
import java.util.UUID; | ||
|
||
@Entity(name = "StudentMapping") | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class StudentMappingEntity implements IWithId<StudentMappingEntity.StudentMappingKey>{ | ||
|
||
// extra short constructor | ||
public StudentMappingEntity(final UUID meitrexStudentId, final String externalStudentId) { | ||
studentMappingKey = new StudentMappingKey(meitrexStudentId, externalStudentId); | ||
} | ||
|
||
@EmbeddedId | ||
private StudentMappingKey studentMappingKey; | ||
|
||
@Data | ||
@Embeddable | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public static class StudentMappingKey implements Serializable { | ||
private UUID meitrexStudentId; | ||
private String externalStudentId; | ||
} | ||
|
||
@Override | ||
public StudentMappingKey getId() { | ||
return studentMappingKey; | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
...gart/iste/meitrex/assignment_service/persistence/repository/StudentMappingRepository.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,10 @@ | ||
package de.unistuttgart.iste.meitrex.assignment_service.persistence.repository; | ||
|
||
import de.unistuttgart.iste.meitrex.assignment_service.persistence.entity.StudentMappingEntity; | ||
import de.unistuttgart.iste.meitrex.common.persistence.MeitrexRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface StudentMappingRepository extends MeitrexRepository<StudentMappingEntity, StudentMappingEntity.StudentMappingKey> { | ||
|
||
} |
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