I have a list of data object that looks as follows:
data class Detail (
val type1: Type1
val type2: Type2
)
val list: List<Detail> = arrayListOf(Detail,Detail,Detail)
How do I bind the the list of details into a JDBI SQL query. I know how to do it with a single data type but just not sure how this works when you are getting properties from the "Detail" data class.
eg:
it.createQuery(
"""
SELECT
id
FROM
tbl_of_something
WHERE
type1
AND
type2
IN (<detail>)
"""
).bindList("detail", list)
.mapTo(String::class.java)
.toSet()
.toList()
.sorted()