|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright 2012-2016 the original author or authors.
|
|
|
|
|
* Copyright 2012-2017 the original author or authors.
|
|
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
@ -36,6 +36,7 @@ import org.springframework.jdbc.support.SQLStateSQLExceptionTranslator;
|
|
|
|
|
* @author Lukas Eder
|
|
|
|
|
* @author Andreas Ahlenstorf
|
|
|
|
|
* @author Phillip Webb
|
|
|
|
|
* @author Stephane Nicoll
|
|
|
|
|
*/
|
|
|
|
|
class JooqExceptionTranslator extends DefaultExecuteListener {
|
|
|
|
|
|
|
|
|
@ -58,8 +59,10 @@ class JooqExceptionTranslator extends DefaultExecuteListener {
|
|
|
|
|
private SQLExceptionTranslator getTranslator(ExecuteContext context) {
|
|
|
|
|
SQLDialect dialect = context.configuration().dialect();
|
|
|
|
|
if (dialect != null && dialect.thirdParty() != null) {
|
|
|
|
|
return new SQLErrorCodeSQLExceptionTranslator(
|
|
|
|
|
dialect.thirdParty().springDbName());
|
|
|
|
|
String dbName = dialect.thirdParty().springDbName();
|
|
|
|
|
if (dbName != null) {
|
|
|
|
|
return new SQLErrorCodeSQLExceptionTranslator(dbName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return new SQLStateSQLExceptionTranslator();
|
|
|
|
|
}
|
|
|
|
|