Browse Source

Revise contribution

Closes gh-32380
pull/32386/head
Sam Brannen 2 years ago
parent
commit
6461eec582
  1. 14
      spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterUtils.java
  2. 12
      spring-r2dbc/src/main/java/org/springframework/r2dbc/core/NamedParameterUtils.java

14
spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterUtils.java

@ -273,9 +273,10 @@ public abstract class NamedParameterUtils { @@ -273,9 +273,10 @@ public abstract class NamedParameterUtils {
* parentheses. This allows for the use of "expression lists" in the SQL statement
* like: <br /><br />
* {@code select id, name, state from table where (name, age) in (('John', 35), ('Ann', 50))}
* <p>The parameter values passed in are used to determine the number of placeholders to
* be used for a select list. Select lists should be limited to 100 or fewer elements and not be empty,
* A larger number of or empty elements is not guaranteed to be supported by the database and
* <p>The parameter values passed in are used to determine the number of
* placeholders to be used for a select list. Select lists should not be empty
* and should be limited to 100 or fewer elements. An empty list or a larger
* number of elements is not guaranteed to be supported by the database and
* is strictly vendor-dependent.
* @param parsedSql the parsed representation of the SQL statement
* @param paramSource the source for named parameters
@ -460,7 +461,7 @@ public abstract class NamedParameterUtils { @@ -460,7 +461,7 @@ public abstract class NamedParameterUtils {
/**
* Parse the SQL statement and locate any placeholders or named parameters.
* Named parameters are substituted for a JDBC placeholder.
* <p>Named parameters are substituted for a JDBC placeholder.
* <p>This is a shortcut version of
* {@link #parseSqlStatement(String)} in combination with
* {@link #substituteNamedParameters(ParsedSql, SqlParameterSource)}.
@ -474,9 +475,10 @@ public abstract class NamedParameterUtils { @@ -474,9 +475,10 @@ public abstract class NamedParameterUtils {
/**
* Parse the SQL statement and locate any placeholders or named parameters.
* Named parameters are substituted for a JDBC placeholder and any select list
* is expanded to the required number of placeholders.
* <p>Named parameters are substituted for a JDBC placeholder, and any select
* list is expanded to the required number of placeholders.
* <p>This is a shortcut version of
* {@link #parseSqlStatement(String)} in combination with
* {@link #substituteNamedParameters(ParsedSql, SqlParameterSource)}.
* @param sql the SQL statement
* @param paramSource the source for named parameters

12
spring-r2dbc/src/main/java/org/springframework/r2dbc/core/NamedParameterUtils.java

@ -275,9 +275,10 @@ abstract class NamedParameterUtils { @@ -275,9 +275,10 @@ abstract class NamedParameterUtils {
* and in that case the placeholders will be grouped and enclosed with parentheses.
* This allows for the use of "expression lists" in the SQL statement like:
* {@code select id, name, state from table where (name, age) in (('John', 35), ('Ann', 50))}
* <p>The parameter values passed in are used to determine the number of placeholders to
* be used for a select list. Select lists should be limited to 100 or fewer elements.
* A larger number of elements is not guaranteed to be supported by the database and
* <p>The parameter values passed in are used to determine the number of
* placeholders to be used for a select list. Select lists should not be empty
* and should be limited to 100 or fewer elements. An empty list or a larger
* number of elements is not guaranteed to be supported by the database and
* is strictly vendor-dependent.
* @param parsedSql the parsed representation of the SQL statement
* @param bindMarkersFactory the bind marker factory.
@ -361,8 +362,11 @@ abstract class NamedParameterUtils { @@ -361,8 +362,11 @@ abstract class NamedParameterUtils {
/**
* Parse the SQL statement and locate any placeholders or named parameters.
* Named parameters are substituted for a native placeholder and any
* <p>Named parameters are substituted for a native placeholder and any
* select list is expanded to the required number of placeholders.
* <p>This is a shortcut version of
* {@link #parseSqlStatement(String)} in combination with
* {@link #substituteNamedParameters(ParsedSql, BindMarkersFactory, BindParameterSource)}.
* @param sql the SQL statement
* @param bindMarkersFactory the bind marker factory
* @param paramSource the source for named parameters

Loading…
Cancel
Save