[ 
https://issues.apache.org/jira/browse/GROOVY-11541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17909597#comment-17909597
 ] 

ASF GitHub Bot commented on GROOVY-11541:
-----------------------------------------

daniellansun commented on PR #2139:
URL: https://github.com/apache/groovy/pull/2139#issuecomment-2569262506

   LGTM.
   
   No worries. JDK 13 and 18 build fails due to timeout unaccountably someday, 
it is tricky for us too.
   




> Sql should accept wildcard parameters
> -------------------------------------
>
>                 Key: GROOVY-11541
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11541
>             Project: Groovy
>          Issue Type: Improvement
>          Components: SQL processing
>    Affects Versions: 5.0.0-alpha-11
>            Reporter: Sergey Chernov
>            Priority: Minor
>
> {{groovy.sql.Sql}} declares several methods with SQL statement and parameters 
> like this
> {code:java}
> public boolean execute(String sql, List<Object> params) throws SLQException {
> {code}
> This declaration has one major drawback: it's not possible to pass as an 
> argument the List which is not exactly {{List<Object>}}, e.g. {{List<Integer> 
> params = List.of(1)}}.
> This List is only iterated, hence using wildcard here is safe. Also changing 
> the type to wildcard as receiving argument should be binary compatible.
> Suggested method signature (example; address all such methods of Sql class):
> {code:java}
> public boolean execute(String sql, List<?> params) throws SLQException {
> {code}
> Additional notes:
> * there are few methods that return {{List<Object>}}, e.g. 
> {{SqlWithParams.getParams()}} - in this case the Object generic should be 
> preserved.
> * For reference: pretty similar problem solved for cassandra-java-driver 
> https://github.com/apache/cassandra-java-driver/commit/be07a77e4f80435a52b1347a07fd566448d9f4ef



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to