|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2021 the original author or authors. |
|
|
|
* Copyright 2002-2023 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
@ -25,8 +25,8 @@ import org.springframework.dao.InvalidDataAccessApiUsageException; |
|
|
|
import org.springframework.lang.Nullable; |
|
|
|
import org.springframework.lang.Nullable; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Simple adapter for {@link PreparedStatementSetter} that applies |
|
|
|
* Simple adapter for {@link PreparedStatementSetter} that applies the given |
|
|
|
* given arrays of arguments and JDBC argument types. |
|
|
|
* arrays of arguments and JDBC argument types. |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Juergen Hoeller |
|
|
|
* @author Juergen Hoeller |
|
|
|
* @since 3.2.3 |
|
|
|
* @since 3.2.3 |
|
|
@ -41,7 +41,8 @@ public class ArgumentTypePreparedStatementSetter implements PreparedStatementSet |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Create a new ArgTypePreparedStatementSetter for the given arguments. |
|
|
|
* Create a new {@code ArgumentTypePreparedStatementSetter} for the given |
|
|
|
|
|
|
|
* arguments and types. |
|
|
|
* @param args the arguments to set |
|
|
|
* @param args the arguments to set |
|
|
|
* @param argTypes the corresponding SQL types of the arguments |
|
|
|
* @param argTypes the corresponding SQL types of the arguments |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -84,15 +85,16 @@ public class ArgumentTypePreparedStatementSetter implements PreparedStatementSet |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set the value for the prepared statement's specified parameter position using the passed in |
|
|
|
* Set the value for the prepared statement's specified parameter position |
|
|
|
* value and type. This method can be overridden by subclasses if needed. |
|
|
|
* using the supplied value and type. |
|
|
|
|
|
|
|
* <p>This method can be overridden by subclasses if needed. |
|
|
|
* @param ps the PreparedStatement |
|
|
|
* @param ps the PreparedStatement |
|
|
|
* @param parameterPosition index of the parameter position |
|
|
|
* @param parameterPosition index of the parameter position |
|
|
|
* @param argType the argument type |
|
|
|
* @param argType the argument type |
|
|
|
* @param argValue the argument value |
|
|
|
* @param argValue the argument value |
|
|
|
* @throws SQLException if thrown by PreparedStatement methods |
|
|
|
* @throws SQLException if thrown by PreparedStatement methods |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected void doSetValue(PreparedStatement ps, int parameterPosition, int argType, Object argValue) |
|
|
|
protected void doSetValue(PreparedStatement ps, int parameterPosition, int argType, @Nullable Object argValue) |
|
|
|
throws SQLException { |
|
|
|
throws SQLException { |
|
|
|
|
|
|
|
|
|
|
|
StatementCreatorUtils.setParameterValue(ps, parameterPosition, argType, argValue); |
|
|
|
StatementCreatorUtils.setParameterValue(ps, parameterPosition, argType, argValue); |
|
|
|