bonjour,
spring boot 2.5.6
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 @Entity @Getter @Setter @NoArgsConstructor @AllArgsConstructor @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id") @Table(name = "t_profil") public class Profil { ... ... @ManyToMany( cascade = { CascadeType.ALL, }, fetch = FetchType.LAZY ) @OnDelete(action = OnDeleteAction.CASCADE) @JoinTable( name = "t_profils_fonctionnalites", joinColumns = { @JoinColumn(name = "profil_id") }, inverseJoinColumns = { @JoinColumn(name = "fonctionnalite_id") } ) public List<Fonctionnalite> fonctionnalites;
ni le profil ni les fonctionnalités, ne sont supprimés. une idée ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 Profil profil = profilDao .findById(id) .orElseThrow(() -> new NoSuchElementException(ErrorConstants.INVALID_PROFIL_ID + id)); profilDao.delete(profil);
Partager