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

Quick Search    Search Deep

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

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

public class SQLExceptionConverterFactory
extends java.lang.Object

A factory for building SQLExceptionConverter instances.


Field Summary
private static org.apache.commons.logging.Log log
           
 
Constructor Summary
private SQLExceptionConverterFactory()
           
 
Method Summary
static SQLExceptionConverter buildMinimalSQLExceptionConverter()
          Builds a minimal converter.
static SQLExceptionConverter buildSQLExceptionConverter(org.hibernate.dialect.Dialect dialect, java.util.Properties properties)
          Build a SQLExceptionConverter instance.
private static SQLExceptionConverter constructConverter(java.lang.String converterClassName, ViolatedConstraintNameExtracter violatedConstraintNameExtracter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log
Constructor Detail

SQLExceptionConverterFactory

private SQLExceptionConverterFactory()
Method Detail

buildSQLExceptionConverter

public static SQLExceptionConverter buildSQLExceptionConverter(org.hibernate.dialect.Dialect dialect,
                                                               java.util.Properties properties)
                                                        throws org.hibernate.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.


buildMinimalSQLExceptionConverter

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


constructConverter

private static SQLExceptionConverter constructConverter(java.lang.String converterClassName,
                                                        ViolatedConstraintNameExtracter violatedConstraintNameExtracter)