Repository navigation
SADU 2.4.2
Rows that cannot be mapped now reach your exception handler like every other query error.
Before updating
- Behaviour change: with
setThrowExceptions(false)(the default), a read whose rows cannot be mapped no longer throwsMappingExceptionat the caller. It returns an empty result, and the error goes to the exception handler and the result's exceptions. Code that caughtMappingExceptionaround a query will not see it any more.
Bugfixes
MappingExceptionskipped the exception handler: errors frommapAsandmapare passed to the handler set withsetExceptionHandler, followsetThrowExceptionsand show up inhasExceptions()andexceptions()of the result.
Improvements
- Dependencies: sqlite-jdbc 3.54.1.0 and jspecify 1.0.1.
Developer notes
- The handler receives a
QueryExceptionwhosegetCause()is theMappingException, and whose message contains the SQL of the query. Check the cause to tell mapping errors apart from database errors. - With
setThrowExceptions(true), the error is thrown asWrappedQueryExecutionException, with theQueryExceptionas its cause. QueryExceptionpasses SQL state and error code toSQLException.getSQLState()andgetErrorCode()return the same values as before for database errors andnulland0for mapping errors.