Top Description Fields Constructors Methods
org.springframework.jdbc.support

public Class CustomSQLExceptionTranslatorRegistrar

extends Object
implements InitializingBean
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.InitializingBean
Imports
java.util.HashMap, .Map, org.springframework.beans.factory.InitializingBean

Registry for custom SQLExceptionTranslator instances for specific databases.
Author
Thomas Risberg
Since
3.1.1

Field Summary

Modifier and TypeField and Description
private final Map<String, SQLExceptionTranslator>
translators

Map registry to hold custom translators specific databases.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
afterPropertiesSet()

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

public void
setTranslators(Map<String, SQLExceptionTranslator> translators)

Setter for a Map of SQLExceptionTranslator references where the key must be the database name as defined in the sql-error-codes.xml file.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

translatorsback to summary
private final Map<String, SQLExceptionTranslator> translators

Map registry to hold custom translators specific databases. Key is the database product name as defined in the org.springframework.jdbc.support.SQLErrorCodesFactory.

Constructor Detail

CustomSQLExceptionTranslatorRegistrarback to summary
public CustomSQLExceptionTranslatorRegistrar()

Method Detail

afterPropertiesSetback to summary
public void afterPropertiesSet()

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Doc from org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

Annotations
@Override
setTranslatorsback to summary
public void setTranslators(Map<String, SQLExceptionTranslator> translators)

Setter for a Map of SQLExceptionTranslator references where the key must be the database name as defined in the sql-error-codes.xml file.

Note that any existing translators will remain unless there is a match in the database name, at which point the new translator will replace the existing one.