aaberg / sql2o

sql2o is a small library, which makes it easy to convert the result of your sql-statements into objects. No resultset hacking required. Kind of like an orm, but without the sql-generation capabilities. Supports named parameters.
http://sql2o.org
MIT License
1.14k stars 230 forks source link

Operation not allowed on execute update with 1.6.0 #326

Open harshathota1991 opened 5 years ago

harshathota1991 commented 5 years ago

I need to use IN clause in a query. We're using version 1.5.4 version of sql2o. When I bind a list of strings to the query, I am getting the below exception java.lang.RuntimeException: Error adding parameter 'ids' - Invalid column type at org.sql2o.Query.addParameterInternal(Query.java:137) at org.sql2o.Query.addParameter(Query.java:173) at org.sql2o.Query.addParameter(Query.java:194)

I had then updated the sql2o version to 1.6 and I am successfully able to bind a list to IN clause in the query. query.addParameter("ids", List<String> ids);

With the new 1.6 version, I am trying to a perform a modify operation when performs an update query. The executeUpdate() is throwing an exception "Operation not allowed". But the same code works with 1.5.4 version of sql2o.

Is this a known issue? Is there any work around where I can use "IN" clause with 1.5.4 version. Please suggest. Thank you