Closed aalster closed 5 months ago
Hi @aalster, You are correct that this is not supported. Each parameter in an SQL query is mapped to a JDBC parameter, and JDBC doesn't support your use case. So, this is not a problem with Sql2o but rather a limitation on JDBC. Check out this Stackoverflow for an example of how to fix it with JDBC directly. You can do something similar with sql2o. https://stackoverflow.com/questions/3107044/preparedstatement-with-list-of-parameters-in-a-in-clause
Method
addParameter
maps enum by it's name. But enums wrapped in a collection are not working properly.Example:
Debugging shows this query in preparedStatement:
Same happens for
addParameter("value", Day.MONDAY, Day.TUESDAY)
,addParameter("value", List.of(Day.MONDAY, Day.TUESDAY).toArray())
Query works properly for
addParameter("value", Day.MONDAY
):sql2o v1.6.0, java 17