Interface ViolatedConstraintNameExtractor

All Known Implementing Classes:
TemplatedViolatedConstraintNameExtractor
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@SPI({USE,IMPLEMENT,SUPPLY}) @FunctionalInterface public interface ViolatedConstraintNameExtractor

Extracts a violated database-constraint name from a vendor SQLException.

Return null when the exception does not expose a constraint name. An absent name must not be represented by an empty string or a sentinel. Implementations may inspect nested vendor exceptions when the driver reports constraint details there.

Since:
8.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Extract the violated constraint name from the given exception.
  • Method Details

    • extractConstraintName

      @Nullable String extractConstraintName(SQLException sqle)
      Extract the violated constraint name from the given exception.
      Parameters:
      sqle - the exception caused by the constraint violation
      Returns:
      the extracted name, or null when no name can be recovered