Polishing

This commit is contained in:
Juergen Hoeller
2018-07-20 16:45:17 +02:00
parent 5007d01c17
commit c3f6403f61
19 changed files with 80 additions and 63 deletions
@@ -520,7 +520,7 @@ public class CallMetaDataContext {
matchedParameters.put(parameterName,
SqlParameterSourceUtils.getTypedValue(parameterSource, sourceName));
}
else {
else if (logger.isWarnEnabled()) {
logger.warn("Unable to locate the corresponding parameter value for '" +
parameterName + "' within the parameter values provided: " +
caseInsensitiveParameterNames.values());
@@ -587,7 +587,7 @@ public class CallMetaDataContext {
for (String parameterName : callParameterNames.keySet()) {
String parameterNameToMatch = provider.parameterNameToUse(parameterName);
String callParameterName = callParameterNames.get(lowerCase(parameterNameToMatch));
if (!matchedParameters.containsKey(callParameterName)) {
if (!matchedParameters.containsKey(callParameterName) && logger.isWarnEnabled()) {
logger.warn("Unable to locate the corresponding parameter value for '" + parameterName +
"' within the parameter values provided: " + inParameters.keySet());
}
@@ -264,7 +264,7 @@ public class TableMetaDataContext {
/**
* Build the insert string based on configuration and meta-data information
* Build the insert string based on configuration and meta-data information.
* @return the insert string to be used
*/
public String createInsertString(String... generatedKeyNames) {
@@ -293,8 +293,10 @@ public class TableMetaDataContext {
insertStatement.append(") VALUES(");
if (columnCount < 1) {
if (this.generatedKeyColumnsUsed) {
logger.info("Unable to locate non-key columns for table '" +
getTableName() + "' so an empty insert statement is generated");
if (logger.isInfoEnabled()) {
logger.info("Unable to locate non-key columns for table '" +
getTableName() + "' so an empty insert statement is generated");
}
}
else {
throw new InvalidDataAccessApiUsageException("Unable to locate columns for table '" +
@@ -360,6 +362,9 @@ public class TableMetaDataContext {
}
/**
* Does this database support a simple query to retrieve generated keys
* when the JDBC 3.0 feature is not supported:
* {@link java.sql.DatabaseMetaData#supportsGetGeneratedKeys()}?
* @deprecated as of 4.3.15, in favor of {@link #getSimpleQueryForGetGeneratedKey}
*/
@Deprecated
@@ -91,8 +91,8 @@ public class EmbeddedDatabaseFactory {
* generation of a pseudo-random unique ID to be used as the database name.
* <p>Setting this flag to {@code true} overrides any explicit name set
* via {@link #setDatabaseName}.
* @see #setDatabaseName
* @since 4.2
* @see #setDatabaseName
*/
public void setGenerateUniqueDatabaseName(boolean generateUniqueDatabaseName) {
this.generateUniqueDatabaseName = generateUniqueDatabaseName;
@@ -187,7 +187,7 @@ public class EmbeddedDatabaseFactory {
if (this.dataSource instanceof SimpleDriverDataSource) {
SimpleDriverDataSource simpleDriverDataSource = (SimpleDriverDataSource) this.dataSource;
logger.info(String.format("Starting embedded database: url='%s', username='%s'",
simpleDriverDataSource.getUrl(), simpleDriverDataSource.getUsername()));
simpleDriverDataSource.getUrl(), simpleDriverDataSource.getUsername()));
}
else {
logger.info(String.format("Starting embedded database '%s'", this.databaseName));
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -124,8 +124,8 @@ public class SQLErrorCodesFactory {
// Check all beans of type SQLErrorCodes.
errorCodes = lbf.getBeansOfType(SQLErrorCodes.class, true, false);
if (logger.isInfoEnabled()) {
logger.info("SQLErrorCodes loaded: " + errorCodes.keySet());
if (logger.isDebugEnabled()) {
logger.debug("SQLErrorCodes loaded: " + errorCodes.keySet());
}
}
catch (BeansException ex) {
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -188,7 +188,7 @@ public class TemporaryLobCreator implements LobCreator {
}
}
catch (SQLException ex) {
logger.error("Could not free LOB", ex);
logger.error("Could not free LOBs", ex);
}
}