added recipe entities

This commit is contained in:
Wyatt J. Miller 2022-05-04 14:31:15 -04:00
parent e71aeaa708
commit ab98d24050

View File

@ -0,0 +1,22 @@
package com.wyattjmiller.data
import org.ktorm.entity.Entity
import org.ktorm.schema.Table
import org.ktorm.schema.int
import org.ktorm.schema.varchar
object DbRecipeTable : Table<DbRecipeEntity>("recipe") {
val id = int("id").primaryKey().bindTo { it.id }
val name = varchar("name").bindTo { it.name }
val desc = varchar("description").bindTo { it.desc }
val ingredients = varchar("ingredients").bindTo { it.ingredients }
}
interface DbRecipeEntity : Entity<DbRecipeEntity> {
companion object : Entity.Factory<DbRecipeEntity>()
val id: Int
val name: String
val desc: String
val ingredients: String
}