From ab98d24050b236079b1fec758de4a2d43c458ad6 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Wed, 4 May 2022 14:31:15 -0400 Subject: [PATCH] added recipe entities --- .../com/wyattjmiller/data/RecipeEntities.kt | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/main/kotlin/com/wyattjmiller/data/RecipeEntities.kt diff --git a/src/main/kotlin/com/wyattjmiller/data/RecipeEntities.kt b/src/main/kotlin/com/wyattjmiller/data/RecipeEntities.kt new file mode 100644 index 0000000..63ec764 --- /dev/null +++ b/src/main/kotlin/com/wyattjmiller/data/RecipeEntities.kt @@ -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("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 { + companion object : Entity.Factory() + + val id: Int + val name: String + val desc: String + val ingredients: String +} \ No newline at end of file