I'm converting a couple of pieces of code to the newest mybatis dynamic sql, and this line is giving me fits:
** Old Code - won't compile with newest version **
fencingSupportMapper.select { where<Int>(facility, isIn(*searchData.selectedFacilities!!)) }
** New Code (not working but compiles) **
val fencingForFacilities: List<Fencing> = fencingSupportMapper.select { where { facility isIn { searchData.selectedFacilities } }
My error is You must specify a select statement in a sub query
Now, my searchData.selectedFacilities
is a list of Int
values (and the facility
column for the WHERE is an int.
Can someone see what's wrong? I've looked at the docs and don't see what's going on here...
Finally figured it out:
fencingSupportMapper.select { where { facility.isIn(*searchData.selectedFacilities!!) } }