Dominick
08/07/2023, 10:27 AMfun Transaction.exec(sql: String, body: PreparedStatementApi.() -> Unit) : ResultSet? {
return connection.prepareStatement(sql, true).apply(body).run {
if (sql.toLowerCase().startsWith("select "))
executeQuery()
else {
executeUpdate()
resultSet
}
}
}
I saw usage of ResultRow.create(ResultSet, Map<Expression, Int>), and it provided Entity#fields to Map<Expression, Int>, but Entity#fields is a List<Expression> instead of a Map to Int. Furthermore, it seems this method uses the index in the result row instead of the name (hinted from GitHub's source of ResultRow#create), which seems risky? Really need to perform a handful of complex queries and still access it as an object to construct a DTO.Jeremy Luinstra
08/07/2023, 9:42 PMResultSet
.Jeremy Luinstra
08/07/2023, 9:44 PM