save
This commit is contained in:
parent
9ffcbf46b1
commit
bfd9a5782a
BIN
data.mv.db
BIN
data.mv.db
Binary file not shown.
@ -18,7 +18,7 @@ public class Reader {
|
|||||||
@Column
|
@Column
|
||||||
private String hashedPassword;
|
private String hashedPassword;
|
||||||
|
|
||||||
@ManyToMany(fetch = FetchType.EAGER)
|
@ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.MERGE)
|
||||||
private List<Manga> mangas;
|
private List<Manga> mangas;
|
||||||
|
|
||||||
public Reader() {
|
public Reader() {
|
||||||
|
@ -92,9 +92,9 @@ public class MangaService {
|
|||||||
public Manga deleteManga(Long id) {
|
public Manga deleteManga(Long id) {
|
||||||
final Manga currentManga = findManga(id);
|
final Manga currentManga = findManga(id);
|
||||||
final List<Reader> listReader = readerService.findAllReaders();
|
final List<Reader> listReader = readerService.findAllReaders();
|
||||||
for (Reader reader : listReader){
|
/* for (Reader reader : listReader){
|
||||||
reader.getMangas().remove(currentManga);
|
reader.getMangas().remove(currentManga);
|
||||||
}
|
}*/
|
||||||
mangaRepository.delete(currentManga);
|
mangaRepository.delete(currentManga);
|
||||||
return currentManga;
|
return currentManga;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user