Iterable < T > function ( final Iterable < T > entities ) { return inTransaction ( new Callable < Iterable < T >> ( ) { @ Override public Iterable < T > call ( ) throws Exception { for ( T object : entities ) { entityManager . persist ( object ) ; } return entities ; } } ) ; }
saves all given entities . use the returned instances for further operations as the operation might have changed the entity instances completely . concode_field_sep EntityManager entityManager concode_elem_sep String pu concode_elem_sep Class<I> idClass concode_elem_sep Repository repository concode_elem_sep Class<T> entity concode_field_sep X inTransaction concode_elem_sep Class<I> getIdClass concode_elem_sep void executeTransactionalBlock concode_elem_sep A executeTransactionalBlock concode_elem_sep Repository getRepository concode_elem_sep T findOne concode_elem_sep T findOne concode_elem_sep long count concode_elem_sep T getAttached concode_elem_sep Iterable<T> findAll concode_elem_sep Iterable<T> findAll concode_elem_sep Iterable<T> findAll concode_elem_sep T delete concode_elem_sep void delete concode_elem_sep Iterable<T> delete concode_elem_sep Class<T> getEntityClass concode_elem_sep boolean exists concode_elem_sep void dispose concode_elem_sep FluentTransaction<R> transaction concode_elem_sep FluentTransaction<R>.Intermediate transaction