Top Description Fields Constructors Methods
org.hibernate.exception.internal

public Class SQLStateConversionDelegate

extends AbstractSQLExceptionConversionDelegate
Class Inheritance
Imports
java.sql.SQLException, java.util.Arrays, .Collections, .HashSet, .Set, org.hibernate.JDBCException, .PessimisticLockException, .QueryTimeoutException, org.hibernate.exception.ConstraintViolationException, .DataException, .JDBCConnectionException, .LockAcquisitionException, .SQLGrammarException, org.hibernate.exception.spi.AbstractSQLExceptionConversionDelegate, .ConversionContext, org.hibernate.internal.util.JdbcExceptionHelper

A SQLExceptionConverter implementation which performs conversion based on the underlying SQLState. Interpretation of a SQL error based on SQLState is not nearly as accurate as using the ErrorCode (which is, however, vendor-specific). SQLState codes are defined by both ANSI SQL specs and X/Open. Some of the "classes" are shared, others are specific to one or another, yet others are custom vendor classes. Unfortunately I have not been able to find a "blessed" list of X/Open codes. These codes are cobbled together between ANSI SQL spec and error code tables from few vendors documentation.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private static final Set<E>
private static final Set<E>
private static final Set<E>
private static final Set<String>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static Set<String>
private static Set<String>
private static Set<String>
private static Set<String>
public JDBCException
convert(SQLException
The SQLException to be converted.
sqlException
,
String
An (optional) error message.
message
,
String
The SQL statement, if one, being performed when the exception occurred.
sql
)

Implements org.hibernate.exception.spi.SQLExceptionConversionDelegate.convert.

Convert the given SQLException into the Hibernate org.hibernate.JDBCException hierarchy.
Inherited from org.hibernate.exception.spi.AbstractSQLExceptionConversionDelegate:
getConversionContext

Field Detail

CONNECTION_CATEGORIESback to summary
private static final Set<E> CONNECTION_CATEGORIES
DATA_CATEGORIESback to summary
private static final Set<E> DATA_CATEGORIES
INTEGRITY_VIOLATION_CATEGORIESback to summary
private static final Set<E> INTEGRITY_VIOLATION_CATEGORIES
SQL_GRAMMAR_CATEGORIESback to summary
private static final Set<String> SQL_GRAMMAR_CATEGORIES

Constructor Detail

SQLStateConversionDelegateback to summary
public SQLStateConversionDelegate(ConversionContext conversionContext)

Method Detail

buildConnectionCategoriesback to summary
private static Set<String> buildConnectionCategories()
buildContraintCategoriesback to summary
private static Set<String> buildContraintCategories()
buildDataCategoriesback to summary
private static Set<String> buildDataCategories()
buildGrammarCategoriesback to summary
private static Set<String> buildGrammarCategories()
convertback to summary
public JDBCException convert(SQLException sqlException, String message, String sql)

Implements org.hibernate.exception.spi.SQLExceptionConversionDelegate.convert.

Doc from org.hibernate.exception.spi.SQLExceptionConversionDelegate.convert.

Convert the given SQLException into the Hibernate org.hibernate.JDBCException hierarchy.

Parameters
sqlException:SQLException

The SQLException to be converted.

message:String

An (optional) error message.

sql:String

The SQL statement, if one, being performed when the exception occurred.

Returns:JDBCException

The resulting JDBCException, can be null

Annotations
@Override