@Test
public void testFidByBlog() {
Blog blog1 = createBlog();
Blog blog2 = createBlog();
for (int i = 0; i < 10; i++) {
Article article = new Article();
article.setTitle("title " + i);
article.setCreationDate(new Date());
article.setText("text " + i);
article.setOpenComments(true);
article.setBlog(blog1);
article.setUser(createUser());
articleDao.merge(article);
}
for (int i = 10; i < 30; i++) {
Article article = new Article();
article.setTitle("title " + i);
article.setCreationDate(new Date());
article.setText("text " + i);
article.setOpenComments(true);
article.setBlog(blog2);
article.setUser(createUser());
articleDao.merge(article);
}
List<Article> blog1Articles = articleDao.findByBlog(blog1);