Skip to content

Commit 6461eec

Browse files
committed
Revise contribution
Closes gh-32380
1 parent be136d7 commit 6461eec

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,10 @@ private static int skipCommentsAndQuotes(char[] statement, int position) {
273273
* parentheses. This allows for the use of "expression lists" in the SQL statement
274274
* like: <br /><br />
275275
* {@code select id, name, state from table where (name, age) in (('John', 35), ('Ann', 50))}
276-
* <p>The parameter values passed in are used to determine the number of placeholders to
277-
* be used for a select list. Select lists should be limited to 100 or fewer elements and not be empty,
278-
* A larger number of or empty elements is not guaranteed to be supported by the database and
276+
* <p>The parameter values passed in are used to determine the number of
277+
* placeholders to be used for a select list. Select lists should not be empty
278+
* and should be limited to 100 or fewer elements. An empty list or a larger
279+
* number of elements is not guaranteed to be supported by the database and
279280
* is strictly vendor-dependent.
280281
* @param parsedSql the parsed representation of the SQL statement
281282
* @param paramSource the source for named parameters
@@ -460,7 +461,7 @@ public static List<SqlParameter> buildSqlParameterList(ParsedSql parsedSql, SqlP
460461

461462
/**
462463
* Parse the SQL statement and locate any placeholders or named parameters.
463-
* Named parameters are substituted for a JDBC placeholder.
464+
* <p>Named parameters are substituted for a JDBC placeholder.
464465
* <p>This is a shortcut version of
465466
* {@link #parseSqlStatement(String)} in combination with
466467
* {@link #substituteNamedParameters(ParsedSql, SqlParameterSource)}.
@@ -474,9 +475,10 @@ public static String parseSqlStatementIntoString(String sql) {
474475

475476
/**
476477
* Parse the SQL statement and locate any placeholders or named parameters.
477-
* Named parameters are substituted for a JDBC placeholder and any select list
478-
* is expanded to the required number of placeholders.
478+
* <p>Named parameters are substituted for a JDBC placeholder, and any select
479+
* list is expanded to the required number of placeholders.
479480
* <p>This is a shortcut version of
481+
* {@link #parseSqlStatement(String)} in combination with
480482
* {@link #substituteNamedParameters(ParsedSql, SqlParameterSource)}.
481483
* @param sql the SQL statement
482484
* @param paramSource the source for named parameters

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,10 @@ private static int skipCommentsAndQuotes(char[] statement, int position) {
275275
* and in that case the placeholders will be grouped and enclosed with parentheses.
276276
* This allows for the use of "expression lists" in the SQL statement like:
277277
* {@code select id, name, state from table where (name, age) in (('John', 35), ('Ann', 50))}
278-
* <p>The parameter values passed in are used to determine the number of placeholders to
279-
* be used for a select list. Select lists should be limited to 100 or fewer elements.
280-
* A larger number of elements is not guaranteed to be supported by the database and
278+
* <p>The parameter values passed in are used to determine the number of
279+
* placeholders to be used for a select list. Select lists should not be empty
280+
* and should be limited to 100 or fewer elements. An empty list or a larger
281+
* number of elements is not guaranteed to be supported by the database and
281282
* is strictly vendor-dependent.
282283
* @param parsedSql the parsed representation of the SQL statement
283284
* @param bindMarkersFactory the bind marker factory.
@@ -361,8 +362,11 @@ private static boolean isParameterSeparator(char c) {
361362

362363
/**
363364
* Parse the SQL statement and locate any placeholders or named parameters.
364-
* Named parameters are substituted for a native placeholder and any
365+
* <p>Named parameters are substituted for a native placeholder and any
365366
* select list is expanded to the required number of placeholders.
367+
* <p>This is a shortcut version of
368+
* {@link #parseSqlStatement(String)} in combination with
369+
* {@link #substituteNamedParameters(ParsedSql, BindMarkersFactory, BindParameterSource)}.
366370
* @param sql the SQL statement
367371
* @param bindMarkersFactory the bind marker factory
368372
* @param paramSource the source for named parameters

0 commit comments

Comments
 (0)