Solved! All I had to do was change this:
Code:
@OneToMany(mappedBy = "article")
For this:
Code:
@OneToMany(mappedBy = "article", cascade = CascadeType.ALL)
But now I get this from console when, for example, an article has 6 comments:
Code:
Hibernate: insert into COMMENT (ARTICLE_ID, DATE, TEXT) values (?, ?, ?)
Hibernate: update ARTICLE set TEXT=?, TITLE=? where ARTICLE_ID=?
Hibernate: update COMMENT set ARTICLE_ID=?, DATE=?, TEXT=? where COMMENT_ID=?
Hibernate: update COMMENT set ARTICLE_ID=?, DATE=?, TEXT=? where COMMENT_ID=?
Hibernate: update COMMENT set ARTICLE_ID=?, DATE=?, TEXT=? where COMMENT_ID=?
Hibernate: update COMMENT set ARTICLE_ID=?, DATE=?, TEXT=? where COMMENT_ID=?
Hibernate: update COMMENT set ARTICLE_ID=?, DATE=?, TEXT=? where COMMENT_ID=?
And more lines of Hibernate: update COMMENT... each time I add a new comment. Is that correct?