Package 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 Description ExceptionMapper()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ExceptionMappergetInstance()Returns the current instance of the Exception mapper to use.static voidsetInstance(ExceptionMapper newInstance)Sets a new instance of an Exception mapper to use.abstract TorqueExceptiontoTorqueException(SQLException sqlException)Maps a SQLException to an appropriate TorqueException.
-
-
-
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.
-
-