I have used cascade on delete so that a post can be deleted without the need to delete each of its comments first. The JPA withing the Java looks like this:
Commnet.java
[...]
@NotNull
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="POST_ID")
private Post post;
[...]
I cannot wait to start using the new blog platform now it is almost finished.
No comments:
Post a Comment