Direct Known Subclasses:
ConfigurationException
,
DataChangedException
,
DataDefinitionException
,
DataException
,
DataMigrationException
,
DataTypeException
,
DetachedException
,
IntegrityConstraintViolationException
,
InvalidResultException
,
IOException
,
LoaderConfigurationException
,
MappingException
,
MockFileDatabaseException
,
ParserException
,
TemplatingException
The
DataAccessException
is a generic
RuntimeException
indicating that something went wrong while executing a SQL statement from
jOOQ.
Unlike JDBC, jOOQ throws
RuntimeException
, knowing that
most
SQLException
types are not recoverable.
even when they are (e.g.
SQLIntegrityConstraintViolationException
), they won't appear with
most statements.
Apart from jOOQ's own
DataAccessException
subtypes, which are thrown
by jOOQ's internals, most
SQLException
types (or
R2dbcException
types) are translated and wrapped by:
DataException
when jOOQ detects
SQLStateClass.C22_DATA_EXCEPTION
.
IntegrityConstraintViolationException
when jOOQ detects
SQLStateClass.C23_INTEGRITY_CONSTRAINT_VIOLATION
.
DataAccessException
otherwise.
Author:
Sergey Epik - Merged into jOOQ from Spring JDBC Support, Lukas Eder
See Also:
Serialized Form
Find a root cause of a given type, or
null
if no root cause
of that type was found.
Methods inherited from class java.lang.
Throwable
addSuppressed
,
fillInStackTrace
,
getCause
,
getLocalizedMessage
,
getMessage
,
getSuppressed
,
initCause
,
printStackTrace
,
printStackTrace
,
printStackTrace
,
setStackTrace
,
toString
Methods inherited from class java.lang.
Object
clone
,
equals
,
finalize
,
getClass
,
hashCode
,
notify
,
notifyAll
,
wait
,
wait
,
wait
DataAccessException
public
DataAccessException
(
String
message)
Constructor for DataAccessException.
Parameters:
message
- the detail message
Constructor for DataAccessException.
Parameters:
message
- the detail message
cause
- the root cause (usually from using a underlying data access
API such as JDBC)
public
@NotNull
String
sqlState
()
sqlStateClass
sqlStateClass
@NotNull
public static
@NotNull
SQLStateClass
sqlStateClass
(io.r2dbc.spi.R2dbcException e)
@Nullable
public
<T extends
Throwable
>
T
getCause
(
Class
<? extends T> type)
Find a root cause of a given type, or
null
if no root cause
of that type was found.