Interface JpaUnitOfWork


  • public interface JpaUnitOfWork
    A unit of work that runs in a JPA transaction, handed to the work of a JpaTransactionRunner. It grants access to the entity manager to work with and nothing else, because the transaction is committed or rolled back by the runner, and may belong to a caller further out.
    Since:
    8.5.6
    Author:
    Norman Lorenz
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      javax.persistence.EntityManager em()
      The entity manager of the transaction this unit of work runs in.
    • Method Detail

      • em

        javax.persistence.EntityManager em()
        The entity manager of the transaction this unit of work runs in. It must not be closed, and its transaction must neither be committed nor rolled back, both belong to the runner.
        Returns:
        the entity manager to work with. Never null.
        Since:
        8.5.6