Interface JpaTask<E extends Exception>

  • Type Parameters:
    E - the type of the checked exception the work may throw, or RuntimeException if it throws none.
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface JpaTask<E extends Exception>
    Work that runs in a JPA transaction without returning a result, executed by JpaTransactionRunner.runInTransaction(JpaTask).
    Since:
    8.5.6
    Author:
    Norman Lorenz
    • Method Detail

      • run

        void run​(JpaUnitOfWork unitOfWork)
          throws E extends Exception
        Performs the work.
        Parameters:
        unitOfWork - the unit of work to use, which grants access to the entity manager.
        Throws:
        E - if the work fails, in which case the transaction is not committed.
        E extends Exception
        Since:
        8.5.6