Interface SQLExceptionConversionDelegate
- All Known Implementing Classes:
AbstractSQLExceptionConversionDelegate
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Converts database-specific SQL exceptions as one step in Hibernate's exception-conversion chain.
Return null when this delegate does not recognize the exception. A null
result deliberately declines conversion and allows the remaining standard
delegates to inspect the same exception. Implementations must not throw or
manufacture a sentinel merely to indicate that they did not handle it.
Implementations should base conversion on stable vendor error codes, SQL
states, or exception subtypes and preserve the supplied SQL text in the
resulting JDBCException when applicable.
- Since:
- 8.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionconvert(SQLException sqlException, String message, String sql) Convert the given exception, or decline conversion by returningnull.
-
Method Details
-
convert
Convert the given exception, or decline conversion by returningnull.- Parameters:
sqlException- the database exception to interpretmessage- the message to use for a converted exceptionsql- the SQL statement which caused the exception- Returns:
- the converted exception, or
nullwhen this delegate does not recognize the exception
-