- Kotlin Blueprints
- Ashish Belagali Hardik Trivedi Akshay Chordiya
- 106字
- 2021-07-02 21:50:18
Exposed objects
The Messages object provides the mapping between the object and the database and it represents the structure of the table. It is required by the Exposed library:
/**
* Message table structure
*/
object Messages : Table() {
val id = integer("id").autoIncrement().primaryKey()
val content = text("content")
val location = point("location").nullable()
}
The following is a diagram of the Message class and the Messages object required for the Exposed library:

We have specified our Messages object for Exposed in the Database.kt file. It is recommended to specify all your Exposed objects in a single Kotlin file for easier maintenance.
推薦閱讀
- Arduino by Example
- MATLAB實(shí)用教程
- 高級(jí)語(yǔ)言程序設(shè)計(jì)(C語(yǔ)言版):基于計(jì)算思維能力培養(yǎng)
- Node.js全程實(shí)例
- Visual Basic程序設(shè)計(jì)教程
- Learning R for Geospatial Analysis
- Kubernetes源碼剖析
- Visual Studio Code 權(quán)威指南
- Go語(yǔ)言開(kāi)發(fā)實(shí)戰(zhàn)(慕課版)
- 微課學(xué)人工智能Python編程
- 從零開(kāi)始學(xué)算法:基于Python
- Building Microservices with Go
- C/C++程序設(shè)計(jì)教程
- iOS應(yīng)用逆向工程:分析與實(shí)戰(zhàn)
- C語(yǔ)言從入門到精通(第4版)