Top Description Methods
org.hibernate.exception.spi

public Interface SQLExceptionConverter

extends Serializable
Known Direct Implementers
org.hibernate.exception.internal.SQLStateConverter, org.hibernate.exception.internal.StandardSQLExceptionConverter
Imports
java.io.Serializable, java.sql.SQLException, org.hibernate.JDBCException

Defines a contract for implementations that know how to convert a SQLException into Hibernate's JDBCException hierarchy. Inspired by Spring's SQLExceptionTranslator.

Implementations must have a constructor which takes a ViolatedConstraintNameExtracter parameter.

Implementations may implement org.hibernate.exception.spi.Configurable if they need to perform configuration steps prior to first use.

Author
Steve Ebersole
See Also
SQLExceptionConverterFactory

Method Summary

Modifier and TypeMethod and Description
public JDBCException

Returns:

The resulting JDBCException.
convert
(SQLException
The SQLException to be converted.
sqlException
,
String
An optional error message.
message
,
String sql)

Convert the given SQLException into the Hibernate JDBCException hierarchy.

Method Detail

convertback to summary
public JDBCException convert(SQLException sqlException, String message, String sql)

Convert the given SQLException into the Hibernate JDBCException hierarchy.

Parameters
sqlException:SQLException

The SQLException to be converted.

message:String

An optional error message.

Returns:JDBCException

The resulting JDBCException.

See Also
, JDBCConnectionException, SQLGrammarException, LockAcquisitionException