You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can also use the static methods in your test method, but it's more complex because Hibernate will try to delay the flush of your entities states at the end of your application transaction,
* You can also use the static methods in your test method, but it's more complex because Hibernate [will try to delay the flush](https://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/chapters/flushing/Flushing.html) of your entities states at the end of your application transaction, here we call flush manually:
36
+
37
+
@Test
38
+
@Transactional
39
+
void create_two_entities() {
40
+
BlogPost post_1 = new BlogPost("Post title 1");
41
+
blogPostRepository.save(post_1);
42
+
entityManager.flush();
43
+
assertInsertStatementCount(1);
44
+
45
+
BlogPost post_2 = new BlogPost("Post title 2");
46
+
blogPostRepository.save(post_2);
47
+
entityManager.flush();
48
+
assertInsertStatementCount(2);
49
+
}
51
50
52
51
## How to integrate
53
-
- Register the integration with Hibernate, you just need to add this key in your configuration (here for yml):
52
+
1. Register the integration with Hibernate, you just need to add this key in your configuration (here for yml):
0 commit comments