added recipe entities
This commit is contained in:
parent
e71aeaa708
commit
ab98d24050
22
src/main/kotlin/com/wyattjmiller/data/RecipeEntities.kt
Normal file
22
src/main/kotlin/com/wyattjmiller/data/RecipeEntities.kt
Normal 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
|
||||||
|
}
|
Reference in New Issue
Block a user