Package org.springframework.jdbc.support
Class CustomSQLExceptionTranslatorRegistrar
- java.lang.Object
- org.springframework.jdbc.support.CustomSQLExceptionTranslatorRegistrar
- All Implemented Interfaces:
InitializingBean
public class CustomSQLExceptionTranslatorRegistrar extends Object implements InitializingBean
Registry for customSQLExceptionTranslator
instances for specific databases.- Since:
- 3.1.1
- Author:
- Thomas Risberg
Constructor Summary
Constructors Constructor Description CustomSQLExceptionTranslatorRegistrar()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.void
setTranslators(Map<String,SQLExceptionTranslator> translators)
Setter for a Map ofSQLExceptionTranslator
references where the key must be the database name as defined in thesql-error-codes.xml
file.
Constructor Detail
CustomSQLExceptionTranslatorRegistrar
public CustomSQLExceptionTranslatorRegistrar()
Method Detail
setTranslators
public void setTranslators(Map<String,SQLExceptionTranslator> translators)
Setter for a Map ofSQLExceptionTranslator
references where the key must be the database name as defined in thesql-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.
afterPropertiesSet
public void afterPropertiesSet()
Description copied from interface:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,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.
- Specified by:
afterPropertiesSet
in interfaceInitializingBean