diff --git a/core/src/main/java/fr/abes/item/core/entities/item/DemandeExemp.java b/core/src/main/java/fr/abes/item/core/entities/item/DemandeExemp.java index 4daf857..27f58f1 100644 --- a/core/src/main/java/fr/abes/item/core/entities/item/DemandeExemp.java +++ b/core/src/main/java/fr/abes/item/core/entities/item/DemandeExemp.java @@ -24,9 +24,6 @@ public class DemandeExemp extends Demande{ @Column(name = "LISTE_ZONES", length = 2000) private String listeZones; - @OneToMany(mappedBy = "demandeExemp", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) - private Set journalDemandes; - @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "DEM_INDEX_RECHERCHE") private IndexRecherche indexRecherche; @@ -34,6 +31,9 @@ public class DemandeExemp extends Demande{ @OneToMany(mappedBy = "demandeExemp", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) private Set ligneFichierExemps; + @OneToMany(mappedBy = "demandeExemp", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) + private Set journalDemandes; + public DemandeExemp(Integer numDemande) { super(numDemande); } diff --git a/core/src/main/java/fr/abes/item/core/entities/item/DemandeRecouv.java b/core/src/main/java/fr/abes/item/core/entities/item/DemandeRecouv.java index 3ab1084..6d25c45 100644 --- a/core/src/main/java/fr/abes/item/core/entities/item/DemandeRecouv.java +++ b/core/src/main/java/fr/abes/item/core/entities/item/DemandeRecouv.java @@ -1,16 +1,14 @@ package fr.abes.item.core.entities.item; import fr.abes.item.core.constant.TYPE_DEMANDE; -import jakarta.persistence.Entity; -import jakarta.persistence.JoinColumn; -import jakarta.persistence.ManyToOne; -import jakarta.persistence.Table; +import jakarta.persistence.*; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import javax.validation.constraints.NotNull; import java.util.Date; +import java.util.Set; @Entity @Table(name = "DEMANDE_RECOUV") @@ -21,6 +19,12 @@ public class DemandeRecouv extends Demande { @JoinColumn(name = "DEM_INDEX_RECHERCHE") private IndexRecherche indexRecherche; + @OneToMany(mappedBy = "demandeRecouv", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) + private Set ligneFichierRecouvs; + + @Getter @Setter @OneToMany(mappedBy = "demandeRecouv", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) + private Set journalDemandeRecouvs; + public DemandeRecouv(@NotNull String rcr, Date dateCreation, Date dateModification, @NotNull EtatDemande etatDemande, String commentaire, Utilisateur utilisateur, IndexRecherche indexRecherche) { super(rcr, dateCreation, dateModification, etatDemande, commentaire, utilisateur); this.indexRecherche = indexRecherche; diff --git a/core/src/main/java/fr/abes/item/core/entities/item/DemandeSupp.java b/core/src/main/java/fr/abes/item/core/entities/item/DemandeSupp.java index 5b703f3..dd478c8 100644 --- a/core/src/main/java/fr/abes/item/core/entities/item/DemandeSupp.java +++ b/core/src/main/java/fr/abes/item/core/entities/item/DemandeSupp.java @@ -34,6 +34,9 @@ public TYPE_DEMANDE getTypeDemande() { @Getter @Setter @OneToMany(mappedBy = "demandeSupp", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) private Set ligneFichierSupps; + @Getter @Setter @OneToMany(mappedBy = "demandeSupp", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) + private Set journalDemandeSupps; + public DemandeSupp(String rcr, Date dateCreation, Date dateModification, TYPE_SUPPRESSION typeSuppression, String comment, EtatDemande etatDemande, Utilisateur utilisateur) { super(rcr, dateCreation, dateModification, etatDemande, comment, utilisateur);