You could iterate through any collection within a transaction and insert each, all item would be batch-inserted together
👍 1
tjohnn
07/13/2019, 9:07 AM
I never tried batchInsert though
t
tapac
07/17/2019, 8:20 PM
@runjorel, batchInsert accepts typed list, not List<Any>. How do you use it?
r
runjorel
07/17/2019, 8:27 PM
I’ve got a feeling it was because I was programming something inside a generic interface. something akin to this:
Copy code
interface CrudRepository<T, ID>{
val table: IdTable<ID>
....
fun saveAll(entities: List<T>) ...
table.batchInsert( entities ){ .. } // where I was getting compiler error for List<Any>