SQLExceptionTranslator implementations that allow for a
fallback to some other SQLExceptionTranslator, as well as for custom
overrides.
doTranslate, setFallbackTranslator, setCustomTranslator
| Modifier and Type | Field and Description |
|---|---|
| private SQLExceptionTranslator | |
| private SQLExceptionTranslator | |
| protected final Log | logger
Logger available to subclasses. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected String | Returns: the messageString to usereadable text describing the task being attempted task, String the SQL statement that caused the problem sql, SQLException the offending ex)SQLExceptionBuild a message |
| protected abstract DataAccessException | Returns: the DataAccessException, wrapping theSQLException;
or null if no exception match foundreadable text describing the task being attempted task, String the SQL query or update that caused the problem (if known) sql, SQLException the offending ex)SQLExceptionTemplate method for actually translating the given exception. |
| public SQLExceptionTranslator | |
| public SQLExceptionTranslator | |
| public void | setCustomTranslator(SQLExceptionTranslator customTranslator)
Set a custom exception translator to override any match that this translator would find. |
| public void | setFallbackTranslator(SQLExceptionTranslator fallback)
Set the fallback translator to use when this translator cannot find a specific match itself. |
| public DataAccessException | translate(String
readable text describing the task being attempted task, String the SQL query or update that caused the problem (if known) sql, SQLException the offending ex)SQLExceptionImplements org. Pre-checks the arguments, calls |
| customTranslator | back to summary |
|---|---|
| private SQLExceptionTranslator customTranslator
| |
| fallbackTranslator | back to summary |
|---|---|
| private SQLExceptionTranslator fallbackTranslator
| |
| logger | back to summary |
|---|---|
| protected final Log logger Logger available to subclasses. | |
| AbstractFallbackSQLExceptionTranslator | back to summary |
|---|---|
| public AbstractFallbackSQLExceptionTranslator() | |
| buildMessage | back to summary |
|---|---|
| protected String buildMessage(String task, String sql, SQLException ex) Build a message To be called by translator subclasses when creating an instance of a generic
| |
| doTranslate | back to summary |
|---|---|
| protected abstract DataAccessException doTranslate(String task, String sql, SQLException ex) Template method for actually translating the given exception. The passed-in arguments will have been pre-checked. Furthermore, this method
is allowed to return
| |
| getCustomTranslator | back to summary |
|---|---|
| public SQLExceptionTranslator getCustomTranslator() Return a custom exception translator, if any.
| |
| getFallbackTranslator | back to summary |
|---|---|
| public SQLExceptionTranslator getFallbackTranslator() Return the fallback exception translator, if any.
| |
| setCustomTranslator | back to summary |
|---|---|
| public void setCustomTranslator(SQLExceptionTranslator customTranslator) Set a custom exception translator to override any match that this translator
would find. Note that such a custom
| |
| setFallbackTranslator | back to summary |
|---|---|
| public void setFallbackTranslator(SQLExceptionTranslator fallback) Set the fallback translator to use when this translator cannot find a specific match itself. | |
| translate | back to summary |
|---|---|
| public DataAccessException translate(String task, String sql, SQLException ex) Implements org. Pre-checks the arguments, calls
| |