23 lines
754 B
Kotlin
23 lines
754 B
Kotlin
package com.example.rehabilitation.db
|
|
|
|
import androidx.room.Room
|
|
import androidx.room.RoomDatabase
|
|
import android.content.Context
|
|
import androidx.room.Database
|
|
|
|
@Database(entities = [Item::class, ItemDaySport::class, ItemImage::class, ItemSportCategory::class], version = 1)
|
|
abstract class MainDB: RoomDatabase() {
|
|
abstract fun getDao(): Dao
|
|
abstract fun getDaoDaySport(): DaoDaySport
|
|
abstract fun getDaoImage(): DaoImage
|
|
abstract fun getDaoSportCategory(): DaoSportCategory
|
|
companion object{
|
|
fun getDB(context: Context):MainDB{
|
|
return Room.databaseBuilder(
|
|
context.applicationContext,
|
|
MainDB::class.java,
|
|
"tttttttttttttt1.db"
|
|
).build()
|
|
}
|
|
}
|
|
} |