Interface R2dbcExceptionMapper

All Superinterfaces:
io.micronaut.core.order.Ordered

public interface R2dbcExceptionMapper extends io.micronaut.core.order.Ordered
The R2dbcException mapper interface. Can be used to map given R2dbc exceptions to some custom exceptions (for example DataAccessException and its descendents like OptimisticLockException).
Since:
4.8.0
  • Field Summary

    Fields inherited from interface io.micronaut.core.order.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull Dialect
     
    mapR2dbcException(@NonNull io.r2dbc.spi.R2dbcException r2dbcException)
    Maps R2dbcException to custom DataAccessException.

    Methods inherited from interface io.micronaut.core.order.Ordered

    getOrder
  • Method Details

    • getDialect

      @NonNull @NonNull Dialect getDialect()
      Returns:
      the Dialect that this mapper supports
    • mapR2dbcException

      @Nullable @Nullable DataAccessException mapR2dbcException(@NonNull @NonNull io.r2dbc.spi.R2dbcException r2dbcException)
      Maps R2dbcException to custom DataAccessException. In case when mapper is not able to map R2dbcException to custom DataAccessException then result will be null indicating that mapper cannot map the exception.
      Parameters:
      r2dbcException - The R2dbc exception
      Returns:
      mapped DataAccessException from R2dbcException or if mapper cannot map R2dbcException then returns null