org.apache.torque.util

## Class ExceptionMapper

- java.lang.Object
- - org.apache.torque.util.ExceptionMapper

- Direct Known Subclasses:
    ExceptionMapperImpl

      public abstract class ExceptionMapper
      extends Object

  Translates Database Exceptions into TorqueExceptions.
  Version:
    $Id: ExceptionMapper.java 1448414 2013-02-20 21:06:35Z tfischer $

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExceptionMapper()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ExceptionMapper` | `getInstance()` Returns the current instance of the Exception mapper to use.
    `static void` | `setInstance(ExceptionMapper newInstance)` Sets a new instance of an Exception mapper to use.
    `abstract TorqueException` | `toTorqueException(SQLException sqlException)` Maps a SQLException to an appropriate TorqueException.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ExceptionMapper

          public ExceptionMapper()

  - ### Method Detail

    - #### getInstance

          public static final ExceptionMapper getInstance()

      Returns the current instance of the Exception mapper to use.
      Returns:
        the current Exception mapper instance.

    - #### setInstance

          public static final void setInstance(ExceptionMapper newInstance)

      Sets a new instance of an Exception mapper to use.
      Parameters:
        `newInstance` - the new Exception mapper instance, not null.

    - #### toTorqueException

          public abstract TorqueException toTorqueException(SQLException sqlException)

      Maps a SQLException to an appropriate TorqueException.
      Parameters:
        `sqlException` - the sqlException to map, not null.
      Returns:
        the maped TorqueException, containing the original exception as a cause, not null.

Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.