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 Details

    • ExceptionMapper

      public ExceptionMapper()
  • Method Details

    • 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.