站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 2.1.8 正式版 API 英文文档

ErrorCodeConverter (Hibernate API Documentation) - Hibernate 2.1.8 正式版 API 英文文档


net.sf.hibernate.exception
Class ErrorCodeConverter

java.lang.Object
  extended bynet.sf.hibernate.exception.ErrorCodeConverter
All Implemented Interfaces:
SQLExceptionConverter

public class ErrorCodeConverter
extends Object
implements SQLExceptionConverter

A SQLExceptionConverter implementation which performs converion based on the vendor specific ErrorCode. This is just intended really as just a base class for converters which know the interpretation of vendor-specific codes.

Author:
Steve Ebersole

Constructor Summary
ErrorCodeConverter(ViolatedConstraintNameExtracter extracter)
           
 
Method Summary
 JDBCException convert(SQLException sqlException, String message)
          Convert the given SQLException into Hibernate's JDBCException hierarchy.
protected  int[] getConnectionErrorCodes()
          The error codes representing issues with a connection.
protected  int[] getIntegrityViolationErrorCodes()
          The error codes representing various types of database integrity issues.
protected  int[] getLockAcquisitionErrorCodes()
           
protected  int[] getSQLGrammarErrorCodes()
          The error codes representing SQL grammar issues.
protected  JDBCException handledNonSpecificException(SQLException sqlException, String message)
          Handle an exception not converted to a specific type based on the built-in checks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorCodeConverter

public ErrorCodeConverter(ViolatedConstraintNameExtracter extracter)
Method Detail

getSQLGrammarErrorCodes

protected int[] getSQLGrammarErrorCodes()
The error codes representing SQL grammar issues.

Returns:
The SQL grammar error codes.

getConnectionErrorCodes

protected int[] getConnectionErrorCodes()
The error codes representing issues with a connection.

Returns:
The connection error codes.

getIntegrityViolationErrorCodes

protected int[] getIntegrityViolationErrorCodes()
The error codes representing various types of database integrity issues.

Returns:
The integrity violation error codes.

getLockAcquisitionErrorCodes

protected int[] getLockAcquisitionErrorCodes()

convert

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

Specified by:
convert in interface SQLExceptionConverter
Parameters:
sqlException - The SQLException to be converted.
message - An optional error message.
Returns:
The resulting JDBCException.
See Also:
ConstraintViolationException, JDBCConnectionException, SQLGrammarException, LockAcquisitionException

handledNonSpecificException

protected JDBCException handledNonSpecificException(SQLException sqlException,
                                                    String message)
Handle an exception not converted to a specific type based on the built-in checks.

Parameters:
sqlException - The exception to be handled.
message - An optional message
Returns:
The converted exception; should never be null.