ConnectionFactoryUtils.convertR2dbcException(String, String, R2dbcException)
instead.@Deprecated public abstract class AbstractFallbackR2dbcExceptionTranslator extends Object implements R2dbcExceptionTranslator
R2dbcExceptionTranslator implementations that allow for fallback to some other
R2dbcExceptionTranslator.| Modifier and Type | Field and Description |
|---|---|
protected Log |
logger
Deprecated.
Logger available to subclasses
|
| Constructor and Description |
|---|
AbstractFallbackR2dbcExceptionTranslator()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
buildMessage(String task,
String sql,
R2dbcException ex)
Deprecated.
Build a message
String for the given R2dbcException. |
protected abstract DataAccessException |
doTranslate(String task,
String sql,
R2dbcException ex)
Deprecated.
Template method for actually translating the given exception.
|
R2dbcExceptionTranslator |
getFallbackTranslator()
Deprecated.
Return the fallback exception translator, if any.
|
void |
setFallbackTranslator(R2dbcExceptionTranslator fallback)
Deprecated.
Override the default SQL state fallback translator (typically a
R2dbcExceptionTranslator). |
DataAccessException |
translate(String task,
String sql,
R2dbcException ex)
Deprecated.
Pre-checks the arguments, calls
doTranslate(java.lang.String, java.lang.String, io.r2dbc.spi.R2dbcException), and invokes the fallback
translator if necessary. |
protected final Log logger
public AbstractFallbackR2dbcExceptionTranslator()
public void setFallbackTranslator(@Nullable R2dbcExceptionTranslator fallback)
R2dbcExceptionTranslator).@Nullable public R2dbcExceptionTranslator getFallbackTranslator()
@NonNull public DataAccessException translate(String task, @Nullable String sql, R2dbcException ex)
doTranslate(java.lang.String, java.lang.String, io.r2dbc.spi.R2dbcException), and invokes the fallback
translator if necessary.translate in interface R2dbcExceptionTranslatortask - readable text describing the task being attempted.sql - SQL query or update that caused the problem (if known).ex - the offending R2dbcException.R2dbcException, or null if no translation could be
applied (in a custom translator; the default translators always throw an
UncategorizedR2dbcException in such a case).NestedRuntimeException.getRootCause()@Nullable protected abstract DataAccessException doTranslate(String task, @Nullable String sql, R2dbcException ex)
The passed-in arguments will have been pre-checked. Furthermore, this method is allowed to return null to indicate that no exception match has been found and that fallback translation should kick in.
task - readable text describing the task being attempted.sql - SQL query or update that caused the problem (if known).ex - the offending R2dbcException.R2dbcException; or null if no exception match
found.protected String buildMessage(String task, @Nullable String sql, R2dbcException ex)
String for the given R2dbcException.
To be called by translator subclasses when creating an instance of a generic
DataAccessException class.
task - readable text describing the task being attempted.sql - the SQL statement that caused the problem.ex - the offending R2dbcException.String to use.Copyright © 2018–2022 Pivotal Software, Inc.. All rights reserved.