sipp11
5 years ago
2 changed files with 22 additions and 1 deletions
@ -0,0 +1,20 @@ |
|||||||
|
package co.zzyzx.sensorlogger |
||||||
|
|
||||||
|
import org.jetbrains.exposed.dao.EntityID |
||||||
|
import org.jetbrains.exposed.dao.IntEntity |
||||||
|
import org.jetbrains.exposed.dao.IntEntityClass |
||||||
|
import org.jetbrains.exposed.dao.IntIdTable |
||||||
|
|
||||||
|
object Records : IntIdTable() { |
||||||
|
val timestamp = datetime("timestamp") |
||||||
|
val sensor = varchar("sensor", 20) |
||||||
|
val data = text("data:") |
||||||
|
} |
||||||
|
|
||||||
|
class Record(id: EntityID<Int>) : IntEntity(id) { |
||||||
|
companion object : IntEntityClass<Record>(Records) |
||||||
|
|
||||||
|
var timestamp by Records.timestamp |
||||||
|
var sensor by Records.sensor |
||||||
|
var data by Records.data |
||||||
|
} |
Loading…
Reference in new issue