org.hibernate.exception.spi
Interface SQLExceptionConverter

All Superinterfaces:
Serializable
All Known Implementing Classes:
SQLStateConverter, StandardSQLExceptionConverter

public interface SQLExceptionConverter
extends Serializable

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 Configurable if they need to perform configuration steps prior to first use.

See Also:
SQLExceptionConverterFactory

Method Summary
 JDBCException convert(SQLException sqlException, String message, String sql)
          Convert the given SQLException into the Hibernate JDBCException hierarchy.
 

Method Detail

convert

JDBCException convert(SQLException sqlException,
                      String message,
                      String sql)
Convert the given SQLException into the Hibernate JDBCException hierarchy.

Parameters:
sqlException - The SQLException to be converted.
message - An optional error message.
Returns:
The resulting JDBCException.
See Also:
, JDBCConnectionException, SQLGrammarException, LockAcquisitionException


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.