How do simply convert from Dao to Entity
Open
- Dominant language
- Kotlin
- Stars
- 9.3k
- Forks
- 798
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 26
Description
class PersonService {
companion object{
fun getTopUser():List{
val userList = ArrayList()
transaction {
**val res = Users.selectAll().limit(5)
res.forEach {
userList.add(User(id = it[Users.id],name =it[Users.name],email = it[Users.email] ))**
}
}
return userList
}
}
}
object Users:Table("user"){
val id = long("id").autoIncrement()
val name = varchar("name",length = 64)
val email = varchar("email",length = 64)
}
data class User(val id:Long,val name:String,val email:String)
Contributor guide
Assessment
This issue has not been assessed yet.