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

SQLExceptionConverterFactory (Hibernate API Documentation) - Hibernate 3.2.4 正式版 API 英文文档


org.hibernate.exception
Class SQLExceptionConverterFactory

java.lang.Object
  extended byorg.hibernate.exception.SQLExceptionConverterFactory

public class SQLExceptionConverterFactory
extends Object

A factory for building SQLExceptionConverter instances.

Author:
Steve Ebersole

Method Summary
static SQLExceptionConverter buildMinimalSQLExceptionConverter()
          Builds a minimal converter.
static SQLExceptionConverter buildSQLExceptionConverter(Dialect dialect, Properties properties)
          Build a SQLExceptionConverter instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

buildSQLExceptionConverter

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 - The defined dialect.
properties - The configuration properties.
Returns:
An appropriate SQLExceptionConverter instance.
Throws:
HibernateException - There was an error building the SQLExceptionConverter.

buildMinimalSQLExceptionConverter

public static SQLExceptionConverter buildMinimalSQLExceptionConverter()
Builds a minimal converter. The instance returned here just always converts to GenericJDBCException.

Returns:
The minimal converter.