Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.hibernate.exception
Class ErrorCodeConverter  view ErrorCodeConverter download ErrorCodeConverter.java

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

public class ErrorCodeConverter
extends java.lang.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.


Field Summary
private  ViolatedConstraintNameExtracter extracter
           
 
Constructor Summary
ErrorCodeConverter(ViolatedConstraintNameExtracter extracter)
           
 
Method Summary
 org.hibernate.JDBCException convert(java.sql.SQLException sqlException, java.lang.String message, java.lang.String sql)
          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  org.hibernate.JDBCException handledNonSpecificException(java.sql.SQLException sqlException, java.lang.String message, java.lang.String sql)
          Handle an exception not converted to a specific type based on the built-in checks.
private  boolean isMatch(int[] errorCodes, int errorCode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

extracter

private ViolatedConstraintNameExtracter extracter
Constructor Detail

ErrorCodeConverter

public ErrorCodeConverter(ViolatedConstraintNameExtracter extracter)
Method Detail

getSQLGrammarErrorCodes

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


getConnectionErrorCodes

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


getIntegrityViolationErrorCodes

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


getLockAcquisitionErrorCodes

protected int[] getLockAcquisitionErrorCodes()

convert

public org.hibernate.JDBCException convert(java.sql.SQLException sqlException,
                                           java.lang.String message,
                                           java.lang.String sql)
Convert the given SQLException into Hibernate's JDBCException hierarchy.

Specified by:
convert in interface SQLExceptionConverter

handledNonSpecificException

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


isMatch

private boolean isMatch(int[] errorCodes,
                        int errorCode)