public class MyBatisExceptionTranslator extends Object implements org.springframework.dao.support.PersistenceExceptionTranslator
DataAccessException using Spring's SQLExceptionTranslator
Can load SQLExceptionTranslator eagerly of when the
first exception is translated.| Constructor and Description |
|---|
MyBatisExceptionTranslator(DataSource dataSource,
boolean exceptionTranslatorLazyInit)
Creates a new
DataAccessExceptionTranslator instance. |
public MyBatisExceptionTranslator(DataSource dataSource, boolean exceptionTranslatorLazyInit)
DataAccessExceptionTranslator instance.dataSource - DataSource to use to find metadata and establish which error codes are usable.exceptionTranslatorLazyInit - if true, the translator instantiates internal stuff only the first time will
have the need to translate exceptions.public org.springframework.dao.DataAccessException translateExceptionIfPossible(RuntimeException e)
translateExceptionIfPossible in interface org.springframework.dao.support.PersistenceExceptionTranslatorCopyright © 2010–2016 MyBatis.org. All rights reserved.