Top Description Fields Constructors Methods
org.hibernate.exception

public Class SQLExceptionConverterFactory

extends Object
Class Inheritance
Imports
org.slf4j.Logger, .LoggerFactory, org.hibernate.HibernateException, .JDBCException, org.hibernate.cfg.Environment, org.hibernate.dialect.Dialect, org.hibernate.util.ReflectHelper, .StringHelper, java.lang.reflect.Constructor, java.sql.SQLException, java.util.Properties

A factory for building SQLExceptionConverter instances.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static SQLExceptionConverter

Returns:

The minimal converter.
buildMinimalSQLExceptionConverter
()

Builds a minimal converter.

public static SQLExceptionConverter

Returns:

An appropriate SQLExceptionConverter instance.
buildSQLExceptionConverter
(Dialect
The defined dialect.
dialect
,
Properties
The configuration properties.
properties
)

Build a SQLExceptionConverter instance.

private static SQLExceptionConverter
constructConverter(String converterClassName, ViolatedConstraintNameExtracter violatedConstraintNameExtracter)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

logback to summary
private static final Logger log

Constructor Detail

SQLExceptionConverterFactoryback to summary
private SQLExceptionConverterFactory()

Method Detail

buildMinimalSQLExceptionConverterback to summary
public static SQLExceptionConverter buildMinimalSQLExceptionConverter()

Builds a minimal converter. The instance returned here just always converts to GenericJDBCException.

Returns:SQLExceptionConverter

The minimal converter.

buildSQLExceptionConverterback to summary
public static SQLExceptionConverter buildSQLExceptionConverter(Dialect dialect, Properties properties) throws HibernateException

Build a SQLExceptionConverter instance.

First, looks for a Environment#SQL_EXCEPTION_CONVERTER property to see if the configuration specified the class of a specific converter to use. If this property is set, attempt to construct an instance of that class. If not set, or if construction fails, the converter specific to the dialect will be used.

Parameters
dialect:Dialect

The defined dialect.

properties:Properties

The configuration properties.

Returns:SQLExceptionConverter

An appropriate SQLExceptionConverter instance.

Exceptions
HibernateException:
There was an error building the SQLExceptionConverter.
constructConverterback to summary
private static SQLExceptionConverter constructConverter(String converterClassName, ViolatedConstraintNameExtracter violatedConstraintNameExtracter)