Files
app/server/src/main/kotlin/books/db/schema/SamplerDAO.kt
T
2026-10-21 23:47:44 +02:00

17 lines
545 B
Kotlin

package net.keinekekse.app.books.db.schema
import org.jetbrains.exposed.v1.core.dao.id.EntityID
import org.jetbrains.exposed.v1.core.dao.id.IntIdTable
import org.jetbrains.exposed.v1.dao.IntEntity
import org.jetbrains.exposed.v1.dao.IntEntityClass
object SamplerTable : IntIdTable("samplers") {
var bookId = reference("book_id", BooksTable.id).uniqueIndex()
}
class SamplerDAO(id: EntityID<Int>) : IntEntity(id) {
companion object : IntEntityClass<SamplerDAO>(SamplerTable)
var book by BookDAO referencedOn SamplerTable.bookId
}