Interface TransactionalConsumer<T extends Transactional<T>,X extends Exception>

Type Parameters:
T - the SqlObject type to provide
X - exception thrown

public interface TransactionalConsumer<T extends Transactional<T>,X extends Exception>
Callback that expects an open transaction and returns no results.
  • Method Details

    • useTransaction

      void useTransaction(T transactional) throws X
      Execute in a transaction. Will be committed afterwards, or rolled back if an exception is thrown.
      Parameters:
      transactional - The object communicating with the database.
      Throws:
      X - any exception thrown will cause the transaction to be rolled back
    • asCallback

      default TransactionalCallback<Void,T,X> asCallback()