Implémentation des différentes classes représentants les tables
This commit is contained in:
parent
7c9fe9235c
commit
69c3a3b965
@ -19,6 +19,7 @@ dependencies {
|
|||||||
implementation("org.springframework.boot:spring-boot-starter-jdbc")
|
implementation("org.springframework.boot:spring-boot-starter-jdbc")
|
||||||
implementation("org.springframework.boot:spring-boot-starter-mail")
|
implementation("org.springframework.boot:spring-boot-starter-mail")
|
||||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||||
|
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||||
// implementation("org.springframework.session:spring-session-jdbc")
|
// implementation("org.springframework.session:spring-session-jdbc")
|
||||||
developmentOnly("org.springframework.boot:spring-boot-devtools")
|
developmentOnly("org.springframework.boot:spring-boot-devtools")
|
||||||
developmentOnly("org.springframework.boot:spring-boot-docker-compose")
|
developmentOnly("org.springframework.boot:spring-boot-docker-compose")
|
||||||
|
16
backend/src/main/java/ovh/herisson/Clyde/Tables/Course.java
Normal file
16
backend/src/main/java/ovh/herisson/Clyde/Tables/Course.java
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package ovh.herisson.Clyde.Tables;
|
||||||
|
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
public class Course {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private int CourseID;
|
||||||
|
private int Credits;
|
||||||
|
private String Title;
|
||||||
|
private String Faculty;
|
||||||
|
}
|
16
backend/src/main/java/ovh/herisson/Clyde/Tables/Cursus.java
Normal file
16
backend/src/main/java/ovh/herisson/Clyde/Tables/Cursus.java
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package ovh.herisson.Clyde.Tables;
|
||||||
|
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
public class Cursus {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private int CursusId;
|
||||||
|
private int Year;
|
||||||
|
private String Option;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package ovh.herisson.Clyde.Tables;
|
||||||
|
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
public class CursusCourse {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private int id;
|
||||||
|
private int CursusId;
|
||||||
|
private int CourseId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package ovh.herisson.Clyde.Tables;
|
||||||
|
|
||||||
|
public enum Role {
|
||||||
|
Teacher,
|
||||||
|
Student;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package ovh.herisson.Clyde.Tables;
|
||||||
|
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
public class Secretary {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private int id;
|
||||||
|
private int RegNo;
|
||||||
|
private String Faculty;
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package ovh.herisson.Clyde.Tables;
|
||||||
|
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
public class TeacherGivenCourse {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private int id;
|
||||||
|
private int RegNo;
|
||||||
|
private int CourseId;
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package ovh.herisson.Clyde.Tables;
|
||||||
|
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
public class TeacherOwnerCourse {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
private int RegNo;
|
||||||
|
private int CourseId;
|
||||||
|
}
|
35
backend/src/main/java/ovh/herisson/Clyde/Tables/User.java
Normal file
35
backend/src/main/java/ovh/herisson/Clyde/Tables/User.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package ovh.herisson.Clyde.Tables;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
//Classe représentant un utilisateur l'attribut password demande surement un peu de rafinement niveau sécurité
|
||||||
|
//et l'attribut tokenApi doit encore être ajouté vu qu'il faut en discuter
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
//Je rajoute un s au nom de la table pour éviter les conflits avec les mots réservés
|
||||||
|
@Table(name = "Users")
|
||||||
|
public class User {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private int RegNo;
|
||||||
|
|
||||||
|
private String LastName;
|
||||||
|
private String FirstName;
|
||||||
|
private String Email;
|
||||||
|
private String Adress;
|
||||||
|
private String Country;
|
||||||
|
private Date BirthDate;
|
||||||
|
private ovh.herisson.Clyde.Tables.Role Role;
|
||||||
|
private String Password;
|
||||||
|
|
||||||
|
public User(String LastName, String FirstName){
|
||||||
|
this.LastName = LastName;
|
||||||
|
this.FirstName = FirstName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public User() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package ovh.herisson.Clyde.Tables;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "User_Cursus")
|
||||||
|
public class UserCursus {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private int id;
|
||||||
|
private int RegNo;
|
||||||
|
private int CursusId;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user