[issue - 245] fix fetch type and cascade
@@ -33,12 +33,10 @@ public class Comment {
@ManyToOne
private Comment parentComment;
- @OneToMany(mappedBy = "parentComment", fetch = FetchType.LAZY,
- cascade = {CascadeType.PERSIST, CascadeType.MERGE, CascadeType.ALL})
+ @OneToMany(mappedBy = "parentComment", cascade = {CascadeType.ALL})
private List<Comment> comments = new ArrayList<>();
- @OneToMany(mappedBy = "comment", fetch = FetchType.LAZY,
- cascade = {CascadeType.PERSIST, CascadeType.MERGE, CascadeType.ALL})
+ @OneToMany(mappedBy = "comment", cascade = {CascadeType.ALL})
private List<Photo> photos = new ArrayList<>();
@OneToOne(cascade = CascadeType.ALL)
