Search code examples
javamysqlibatis

Does Ibatis support Sets as parameter classes?


Does anyone know if Ibatis accepts Sets as parameter classes? I didn't see any docs on it, but when I did try it failed and told me it was looking for a list.


Solution

  • It depends on usage. If you would like to iterate the elements of set for building IN (...) query, there is a way to do that with using iterate element. If it doesnt work you might need to convert your Set to List and pass your variable as a list.

    List list = new ArrayList(new HashSet());