public void withTransaction ( Consumer < EntityManager > block ) { withTransaction ( em -> { block . accept ( em ) ; return null ; } ) ; }
Run a block of code with a newly created EntityManager for the default Persistence Unit .