【发布时间】:2018-05-14 21:06:52
【问题描述】:
- 如何将选择查询映射到类
-
是否有任何@transactional 注释来执行查询?
object UserRepository { fun getAll() : List<User> { return User.selectAll().map { User } // how to add it in a transaction ? // Is it the right way to map query to a Class ? } fun get(id: Int) : User? { return User.select { User.id eq id id}.map { User.it } // Mapping Not working }
【问题讨论】:
-
我建议你从阅读那篇博文开始spring.io/blog/2016/03/20/…
标签: sql kotlin kotlin-exposed