@Test
public void should_save_and_flush() throws Exception
{
// given
Simple simple = new Simple("test");
// when
simple = repo.saveAndFlush(simple);
Simple fetch = (Simple) entityManager
.createNativeQuery("select * from simple_table where id = ?", Simple.class)
.setParameter(1, simple.getId())
.getSingleResult();
// then
assertEquals(simple.getId(), fetch.getId());
}