public final class CustomSQLExceptionTranslatorRegistry
extends java.lang.Object
SQLExceptionTranslator
instances associated with
specific databases allowing for overriding translation based on values contained in the configuration file
named "sql-error-codes.xml".SQLErrorCodesFactory
Modifier and Type | Method and Description |
---|---|
SQLExceptionTranslator |
findTranslatorForDatabase(java.lang.String dbName)
Find a custom translator for the specified database.
|
static CustomSQLExceptionTranslatorRegistry |
getInstance()
Return the singleton instance.
|
void |
registerTranslator(java.lang.String dbName,
SQLExceptionTranslator translator)
Register a new custom translator for the specified database name.
|
public static CustomSQLExceptionTranslatorRegistry getInstance()
public void registerTranslator(java.lang.String dbName, SQLExceptionTranslator translator)
dbName
- the database nametranslator
- the custom translator@Nullable public SQLExceptionTranslator findTranslatorForDatabase(java.lang.String dbName)
dbName
- the database namenull
if none found