Polishing

This commit is contained in:
Juergen Hoeller
2018-02-25 21:44:34 +01:00
parent 39ddd0f349
commit d4af8c86b2
6 changed files with 40 additions and 39 deletions

View File

@@ -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.
@@ -55,6 +55,7 @@ public class CallableStatementCreatorFactory {
/**
* Create a new factory. Will need to add parameters via the
* {@link #addParameter} method or have no parameters.
* @param callString the SQL call string
*/
public CallableStatementCreatorFactory(String callString) {
this.callString = callString;

View File

@@ -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.
@@ -56,7 +56,7 @@ public class PreparedStatementCreatorFactory {
private boolean returnGeneratedKeys = false;
private String[] generatedKeysColumnNames = null;
private String[] generatedKeysColumnNames;
private NativeJdbcExtractor nativeJdbcExtractor;
@@ -64,6 +64,7 @@ public class PreparedStatementCreatorFactory {
/**
* Create a new factory. Will need to add parameters via the
* {@link #addParameter} method or have no parameters.
* @param sql the SQL statement to execute
*/
public PreparedStatementCreatorFactory(String sql) {
this.sql = sql;
@@ -72,7 +73,7 @@ public class PreparedStatementCreatorFactory {
/**
* Create a new factory with the given SQL and JDBC types.
* @param sql SQL to execute
* @param sql the SQL statement to execute
* @param types int array of JDBC types
*/
public PreparedStatementCreatorFactory(String sql, int... types) {
@@ -82,9 +83,8 @@ public class PreparedStatementCreatorFactory {
/**
* Create a new factory with the given SQL and parameters.
* @param sql SQL
* @param sql the SQL statement to execute
* @param declaredParameters list of {@link SqlParameter} objects
* @see SqlParameter
*/
public PreparedStatementCreatorFactory(String sql, List<SqlParameter> declaredParameters) {
this.sql = sql;

View File

@@ -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.
@@ -104,8 +104,8 @@ public class NamedParameterJdbcTemplate implements NamedParameterJdbcOperations
/**
* Expose the classic Spring JdbcTemplate to allow invocation of
* less commonly used methods.
* Expose the classic Spring JdbcTemplate operations to allow invocation
* of less commonly used methods.
*/
@Override
public JdbcOperations getJdbcOperations() {
@@ -329,12 +329,14 @@ public class NamedParameterJdbcTemplate implements NamedParameterJdbcOperations
getParsedSql(sql), batchArgs, getJdbcOperations());
}
/**
* Build a PreparedStatementCreator based on the given SQL and named parameters.
* <p>Note: Not used for the {@code update} variant with generated key handling.
* @param sql SQL to execute
* Build a {@link PreparedStatementCreator} based on the given SQL and named parameters.
* <p>Note: Directly called from all {@code query} variants.
* Not used for the {@code update} variant with generated key handling.
* @param sql the SQL statement to execute
* @param paramSource container of arguments to bind
* @return the corresponding PreparedStatementCreator
* @return the corresponding {@link PreparedStatementCreator}
*/
protected PreparedStatementCreator getPreparedStatementCreator(String sql, SqlParameterSource paramSource) {
ParsedSql parsedSql = getParsedSql(sql);
@@ -347,9 +349,8 @@ public class NamedParameterJdbcTemplate implements NamedParameterJdbcOperations
/**
* Obtain a parsed representation of the given SQL statement.
* <p>The default implementation uses an LRU cache with an upper limit
* of 256 entries.
* @param sql the original SQL
* <p>The default implementation uses an LRU cache with an upper limit of 256 entries.
* @param sql the original SQL statement
* @return a representation of the parsed SQL statement
*/
protected ParsedSql getParsedSql(String sql) {