fix: removed contradictive @NotNull preventing to add data to database.
This commit is contained in:
parent
dded62c25a
commit
215d80ad70
@ -13,14 +13,14 @@ import java.util.List;
|
|||||||
public class Administrator extends User {
|
public class Administrator extends User {
|
||||||
|
|
||||||
@OneToMany(mappedBy = "projectAdministrator", fetch = FetchType.LAZY, orphanRemoval = true)
|
@OneToMany(mappedBy = "projectAdministrator", fetch = FetchType.LAZY, orphanRemoval = true)
|
||||||
private List<Project> listProject = new ArrayList<>();
|
private final List<Project> listProject = new ArrayList<>();
|
||||||
|
|
||||||
/*@OneToMany(mappedBy = "administratorSectionCell", fetch = FetchType.LAZY, orphanRemoval = true)
|
/*@OneToMany(mappedBy = "administratorSectionCell", fetch = FetchType.LAZY, orphanRemoval = true)
|
||||||
private List<SectionCell> listSectionCell = new ArrayList<>();*/
|
private List<SectionCell> listSectionCell = new ArrayList<>();*/
|
||||||
// should now be useless
|
// should now be useless
|
||||||
|
|
||||||
@OneToMany(mappedBy = "administratorAnnotation", fetch = FetchType.LAZY, orphanRemoval = true)
|
@OneToMany(mappedBy = "administratorAnnotation", fetch = FetchType.LAZY, orphanRemoval = true)
|
||||||
private List<Annotation> listAnnotation = new ArrayList<>();
|
private final List<Annotation> listAnnotation = new ArrayList<>();
|
||||||
|
|
||||||
/*@OneToMany(mappedBy = "administratorAppointment", fetch = FetchType.LAZY, orphanRemoval = true)
|
/*@OneToMany(mappedBy = "administratorAppointment", fetch = FetchType.LAZY, orphanRemoval = true)
|
||||||
private final List<Appointment> listAppointment = new ArrayList<>();*/
|
private final List<Appointment> listAppointment = new ArrayList<>();*/
|
||||||
@ -32,12 +32,11 @@ public class Administrator extends User {
|
|||||||
public Administrator() {}
|
public Administrator() {}
|
||||||
|
|
||||||
public Administrator(
|
public Administrator(
|
||||||
Long idUser,
|
|
||||||
String userSurname,
|
String userSurname,
|
||||||
String username,
|
String username,
|
||||||
String mainMail,
|
String mainMail,
|
||||||
String secondaryMail,
|
String secondaryMail,
|
||||||
String phoneNumber) {
|
String phoneNumber) {
|
||||||
super(idUser, userSurname, username, mainMail, secondaryMail, phoneNumber);
|
super(null, userSurname, username, mainMail, secondaryMail, phoneNumber);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
package enseirb.myinpulse.model;
|
package enseirb.myinpulse.model;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "annotation")
|
@Table(name = "annotation")
|
||||||
public class Annotation {
|
public class Annotation {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@NotNull
|
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long idAnnotation;
|
private Long idAnnotation;
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package enseirb.myinpulse.model;
|
package enseirb.myinpulse.model;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
@ -17,9 +16,6 @@ public class Appointment {
|
|||||||
new ArrayList<>(); */
|
new ArrayList<>(); */
|
||||||
// should now be useless
|
// should now be useless
|
||||||
|
|
||||||
@OneToOne(mappedBy = "appointmentReport", fetch = FetchType.LAZY, orphanRemoval = true)
|
|
||||||
private Report report;
|
|
||||||
|
|
||||||
@ManyToMany(
|
@ManyToMany(
|
||||||
fetch = FetchType.LAZY,
|
fetch = FetchType.LAZY,
|
||||||
cascade = {CascadeType.ALL})
|
cascade = {CascadeType.ALL})
|
||||||
@ -28,9 +24,9 @@ public class Appointment {
|
|||||||
joinColumns = @JoinColumn(name = "idAppointment"),
|
joinColumns = @JoinColumn(name = "idAppointment"),
|
||||||
inverseJoinColumns = @JoinColumn(name = "idSectionCell"))
|
inverseJoinColumns = @JoinColumn(name = "idSectionCell"))
|
||||||
List<SectionCell> listSectionCell = new ArrayList<>();
|
List<SectionCell> listSectionCell = new ArrayList<>();
|
||||||
|
@OneToOne(mappedBy = "appointmentReport", fetch = FetchType.LAZY, orphanRemoval = true)
|
||||||
|
private Report report;
|
||||||
@Id
|
@Id
|
||||||
@NotNull
|
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long idAppointment;
|
private Long idAppointment;
|
||||||
|
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
package enseirb.myinpulse.model;
|
package enseirb.myinpulse.model;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "make_appointment")
|
@Table(name = "make_appointment")
|
||||||
public class MakeAppointment {
|
public class MakeAppointment {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@NotNull
|
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long idMakeAppointment;
|
private Long idMakeAppointment;
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package enseirb.myinpulse.model;
|
package enseirb.myinpulse.model;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -18,7 +17,6 @@ public class Project {
|
|||||||
private final List<SectionCell> listSectionCell = new ArrayList<>();
|
private final List<SectionCell> listSectionCell = new ArrayList<>();
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@NotNull
|
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long idProject;
|
private Long idProject;
|
||||||
|
|
||||||
|
@ -4,14 +4,12 @@ import jakarta.persistence.*;
|
|||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
import jakarta.persistence.Id;
|
import jakarta.persistence.Id;
|
||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "report")
|
@Table(name = "report")
|
||||||
public class Report {
|
public class Report {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@NotNull
|
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long idReport;
|
private Long idReport;
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package enseirb.myinpulse.model;
|
package enseirb.myinpulse.model;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -18,7 +17,6 @@ public class SectionCell {
|
|||||||
private final List<Annotation> listAnnotation = new ArrayList<>();
|
private final List<Annotation> listAnnotation = new ArrayList<>();
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@NotNull
|
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long idSectionCell;
|
private Long idSectionCell;
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package enseirb.myinpulse.model;
|
package enseirb.myinpulse.model;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "user_inpulse")
|
@Table(name = "user_inpulse")
|
||||||
@ -9,7 +8,6 @@ import jakarta.validation.constraints.NotNull;
|
|||||||
public class User {
|
public class User {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@NotNull
|
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long idUser;
|
private Long idUser;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user