@Test
void testPostgresNative() {
final EntityManager entityManager = postgresFactory.createEntityManager();
entityManager.getTransaction().begin();
final int count1 = entityManager.createNativeQuery("INSERT INTO custom_post (body, published_at, title) VALUES (?, ?, ?) ON CONFLICT DO NOTHING")
.setParameter(1, "Some body")
.setParameter(2, LocalDate.of(2019, 1, 1))
.setParameter(3, "Some title")
.executeUpdate();
Assertions.assertEquals(1, count1);
final int count2 = entityManager.createNativeQuery("INSERT INTO custom_post (body, published_at, title) VALUES (?, ?, ?) ON CONFLICT DO NOTHING")
.setParameter(1, "Some body")
.setParameter(2, LocalDate.of(2019, 1, 2))
.setParameter(3, "Some title")
.executeUpdate();
Assertions.assertEquals(0, count2);
entityManager.getTransaction().commit();
entityManager.close();
}