NamedParameterUtils.java (spring-framework-5.3.23) | : | NamedParameterUtils.java (spring-framework-5.3.24) | ||
---|---|---|---|---|
skipping to change at line 40 | skipping to change at line 40 | |||
import org.springframework.lang.Nullable; | import org.springframework.lang.Nullable; | |||
import org.springframework.r2dbc.core.binding.BindMarker; | import org.springframework.r2dbc.core.binding.BindMarker; | |||
import org.springframework.r2dbc.core.binding.BindMarkers; | import org.springframework.r2dbc.core.binding.BindMarkers; | |||
import org.springframework.r2dbc.core.binding.BindMarkersFactory; | import org.springframework.r2dbc.core.binding.BindMarkersFactory; | |||
import org.springframework.r2dbc.core.binding.BindTarget; | import org.springframework.r2dbc.core.binding.BindTarget; | |||
import org.springframework.util.Assert; | import org.springframework.util.Assert; | |||
/** | /** | |||
* Helper methods for named parameter parsing. | * Helper methods for named parameter parsing. | |||
* | * | |||
* <p>Only intended for internal use within Spring's R2DBC | * <p>Only intended for internal use within Spring's R2DBC framework. | |||
* framework. | ||||
* | * | |||
* <p>References to the same parameter name are substituted with | * <p>References to the same parameter name are substituted with | |||
* the same bind marker placeholder if a {@link BindMarkersFactory} uses | * the same bind marker placeholder if a {@link BindMarkersFactory} uses | |||
* {@link BindMarkersFactory#identifiablePlaceholders() identifiable} | * {@link BindMarkersFactory#identifiablePlaceholders() identifiable} | |||
* placeholders. | * placeholders. | |||
* | * | |||
* @author Thomas Risberg | * @author Thomas Risberg | |||
* @author Juergen Hoeller | * @author Juergen Hoeller | |||
* @author Mark Paluch | * @author Mark Paluch | |||
* @since 5.3 | * @since 5.3 | |||
skipping to change at line 295 | skipping to change at line 294 | |||
for (int i = 0; i < paramNames.size(); i++) { | for (int i = 0; i < paramNames.size(); i++) { | |||
String paramName = paramNames.get(i); | String paramName = paramNames.get(i); | |||
int[] indexes = parsedSql.getParameterIndexes(i); | int[] indexes = parsedSql.getParameterIndexes(i); | |||
int startIndex = indexes[0]; | int startIndex = indexes[0]; | |||
int endIndex = indexes[1]; | int endIndex = indexes[1]; | |||
actualSql.append(originalSql, lastIndex, startIndex); | actualSql.append(originalSql, lastIndex, startIndex); | |||
NamedParameters.NamedParameter marker = markerHolder.getO rCreate(paramName); | NamedParameters.NamedParameter marker = markerHolder.getO rCreate(paramName); | |||
if (paramSource.hasValue(paramName)) { | if (paramSource.hasValue(paramName)) { | |||
Object value = paramSource.getValue(paramName); | Object value = paramSource.getValue(paramName); | |||
if (value instanceof Collection) { | if (value instanceof Collection) { | |||
Iterator<?> entryIter = ((Collection<?>) value).iterator(); | Iterator<?> entryIter = ((Collection<?>) value).iterator(); | |||
int k = 0; | int k = 0; | |||
int counter = 0; | int counter = 0; | |||
while (entryIter.hasNext()) { | while (entryIter.hasNext()) { | |||
if (k > 0) { | if (k > 0) { | |||
actualSql.append(", "); | actualSql.append(", "); | |||
} | } | |||
k++; | k++; | |||
Object entryItem = entryIter.next (); | Object entryItem = entryIter.next (); | |||
if (entryItem instanceof Object[] ) { | if (entryItem instanceof Object[] ) { | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 1 lines changed or added |