Package st.orm.spi

Interface ExceptionContext


public interface ExceptionContext
Describes the execution context in which a failure occurred.

An instance of this interface is passed to the ExceptionMapper configured on the ORM template, allowing the mapper to base its translation on the SQL operation, the statement text and the affected data type.

Since:
1.13
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<Class<? extends Data>>
    Returns the entity or projection type primarily affected by the failed operation.
    Classifies the kind of SQL statement that failed.
    Returns the SQL statement that failed, with all parameters replaced by placeholders.
    Returns a description of the transaction in whose scope the failure occurred.
  • Method Details

    • operation

      SqlOperation operation()
      Classifies the kind of SQL statement that failed.
      Returns:
      the SQL operation; SqlOperation.UNDEFINED when the operation is unknown.
    • statement

      Optional<String> statement()
      Returns the SQL statement that failed, with all parameters replaced by placeholders.
      Returns:
      the SQL statement, or empty when no statement is associated with the failure.
    • dataType

      Optional<Class<? extends Data>> dataType()
      Returns the entity or projection type primarily affected by the failed operation.
      Returns:
      the affected data type, or empty when the operation is not associated with a specific type.
    • transactionDescription

      Optional<String> transactionDescription()
      Returns a description of the transaction in whose scope the failure occurred.
      Returns:
      the transaction description, or empty when no transaction is active or the transaction subsystem does not provide a description.