From 54fdb8fe1cd3b6b8a161d01edbd686a6c740c4c5 Mon Sep 17 00:00:00 2001 From: Yanming Zhou Date: Wed, 6 Mar 2024 10:30:33 +0800 Subject: [PATCH] Polishing javadoc of NamedParameterUtils.substituteNamedParameters() Document that empty list is guaranteed to be supported by the database, for example MySQL and PostgreSQL doesn't support `foo in ()`. --- .../jdbc/core/namedparam/NamedParameterUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterUtils.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterUtils.java index ad74063dabe..aee35e52fcf 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterUtils.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterUtils.java @@ -274,8 +274,8 @@ private static int skipCommentsAndQuotes(char[] statement, int position) { * like:

* {@code select id, name, state from table where (name, age) in (('John', 35), ('Ann', 50))} *

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 + * 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 * is strictly vendor-dependent. * @param parsedSql the parsed representation of the SQL statement * @param paramSource the source for named parameters