Package org.apache.torque.util
Class ExceptionMapper
java.lang.Object
org.apache.torque.util.ExceptionMapper
- Direct Known Subclasses:
ExceptionMapperImpl
Translates Database Exceptions into TorqueExceptions.
- Version:
- $Id: ExceptionMapper.java 1448414 2013-02-20 21:06:35Z tfischer $
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final ExceptionMapperReturns the current instance of the Exception mapper to use.static final voidsetInstance(ExceptionMapper newInstance) Sets a new instance of an Exception mapper to use.abstract TorqueExceptiontoTorqueException(SQLException sqlException) Maps a SQLException to an appropriate TorqueException.
-
Constructor Details
-
ExceptionMapper
public ExceptionMapper()
-
-
Method Details
-
getInstance
Returns the current instance of the Exception mapper to use.- Returns:
- the current Exception mapper instance.
-
setInstance
Sets a new instance of an Exception mapper to use.- Parameters:
newInstance- the new Exception mapper instance, not null.
-
toTorqueException
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.
-