LeoMoulin/Backend/Leo #55
@ -8,7 +8,7 @@ public class Secretary {
|
|||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
private int id;
|
private int id;
|
||||||
|
|
||||||
@JoinColumn(name = "User")
|
@JoinColumn(name = "Users")
|
||||||
private int regNo;
|
private int regNo;
|
||||||
private String faculty;
|
private String faculty;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ public class TeacherGivenCourse {
|
|||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
private int id;
|
private int id;
|
||||||
|
|
||||||
@JoinColumn(name = "User")
|
@JoinColumn(name = "Users")
|
||||||
private int regNo;
|
private int regNo;
|
||||||
|
|
||||||
@JoinColumn(name = "Course")
|
@JoinColumn(name = "Course")
|
||||||
|
@ -1,21 +1,20 @@
|
|||||||
package ovh.herisson.Clyde.Tables;
|
package ovh.herisson.Clyde.Tables;
|
||||||
|
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.*;
|
||||||
import jakarta.persistence.GeneratedValue;
|
|
||||||
import jakarta.persistence.GenerationType;
|
|
||||||
import jakarta.persistence.Id;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
public class Token {
|
public class Token {
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
@Id
|
@Id
|
||||||
private int id;
|
private int id;
|
||||||
private int regNo;
|
|
||||||
private String data;
|
|
||||||
|
|
||||||
public Token(int regNo, String data){
|
@JoinColumn(name ="Users")
|
||||||
|
private int regNo;
|
||||||
|
private String token;
|
||||||
|
|||||||
|
|
||||||
Maxime
commented
data ? peut-être être plus précis dans le nom ? data ? peut-être être plus précis dans le nom ?
LeoMoulin
commented
Je vais juste le rename en token comme ca c'est plié ! Je vais juste le rename en token comme ca c'est plié !
|
|||||||
|
public Token(int regNo, String token){
|
||||||
this.regNo = regNo;
|
this.regNo = regNo;
|
||||||
this.data = data;
|
this.token = token;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Token(){}
|
public Token(){}
|
||||||
@ -31,11 +30,11 @@ public class Token {
|
|||||||
this.regNo = regNo;
|
this.regNo = regNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getData(){
|
public String getToken(){
|
||||||
return data;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setData(String data) {
|
public void setToken(String data) {
|
||||||
this.data = data;
|
this.token = data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,22 +17,20 @@ public class User {
|
|||||||
private String lastName;
|
private String lastName;
|
||||||
private String firstName;
|
private String firstName;
|
||||||
private String email;
|
private String email;
|
||||||
private String adress;
|
private String address;
|
||||||
private String country;
|
private String country;
|
||||||
private Date birthDate;
|
private Date birthDate;
|
||||||
private ovh.herisson.Clyde.Tables.Role role;
|
private ovh.herisson.Clyde.Tables.Role role;
|
||||||
private String password;
|
private String password;
|
||||||
private String salt;
|
public User(String lastName, String firstName, String email, String address, String country, Date birthDate, Role role, String password){
|
||||||
public User(String lastName, String firstName, String email, String adress, String country, Date birthDate, Role role, String password, String salt){
|
|
||||||
this.lastName = lastName;
|
this.lastName = lastName;
|
||||||
this.firstName = firstName;
|
this.firstName = firstName;
|
||||||
this.email = email;
|
this.email = email;
|
||||||
this.adress = adress;
|
this.address = address;
|
||||||
this.country = country;
|
this.country = country;
|
||||||
this.birthDate = birthDate;
|
this.birthDate = birthDate;
|
||||||
this.role = role;
|
this.role = role;
|
||||||
this.password = password;
|
this.password = password;
|
||||||
this.salt = salt;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Maxime
commented
Pas Salt ! Pas Salt !
|
|||||||
public User() {}
|
public User() {}
|
||||||
@ -64,12 +62,12 @@ public class User {
|
|||||||
this.email = email;
|
this.email = email;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAdress() {
|
public String getAddress() {
|
||||||
return adress;
|
return address;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAdress(String adress) {
|
public void setAddress(String adress) {
|
||||||
this.adress = adress;
|
this.address = adress;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCountry() {
|
public String getCountry() {
|
||||||
@ -102,12 +100,4 @@ public class User {
|
|||||||
public void setPassword(String password) {
|
public void setPassword(String password) {
|
||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSalt(){
|
|
||||||
return salt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSalt(String salt) {
|
|
||||||
this.salt = salt;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -3,12 +3,11 @@ package ovh.herisson.Clyde.Tables;
|
|||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "User_Cursus")
|
|
||||||
public class UserCursus {
|
public class UserCursus {
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
private int id;
|
private int id;
|
||||||
@JoinColumn(name = "User")
|
@JoinColumn(name = "Users")
|
||||||
private int regNo;
|
private int regNo;
|
||||||
|
|
||||||
@JoinColumn(name = "Cursus")
|
@JoinColumn(name = "Cursus")
|
||||||
|
Loading…
Reference in New Issue
Block a user
Pourquoi pas directement un User ici ? où y'a pas moyen de faire un link vers la table Users ?
J'ai suivi les champs de la table ! J'ai aussi oublié de le mettre en foreign key c'est vrai je vais faire ca j'avoues que j'ai pas pensé a mettre directement une référence vers un objet user j'avoues que je ne sais pas comment ca va se comporter je vais essayer d'approfondir.
Ok check comme ça si on peut chopper le User en une seule query sans pour autant stocker une deuxième fois la table User C parfait