package com.various.funny.sounds.audio.db

import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import com.various.funny.sounds.audio.VariousFunnySounds
import com.various.funny.sounds.audio.data.NewBean
import com.various.funny.sounds.audio.data.NewBeanChild
import com.various.funny.sounds.audio.helper.ComUtils


@Database(
    entities = [NewBean::class, NewBeanChild::class],
    version = ComUtils.DB_Version,
    exportSchema = false
)
abstract class MyRoomBase : RoomDatabase() {
    companion object {
          val dataBase: MyRoomBase by lazy { getInstance() }
        private fun getInstance(): MyRoomBase {
            return Room.databaseBuilder(
                VariousFunnySounds.appContext,
                MyRoomBase::class.java,
                ComUtils.DB_Name
            ).build()
        }
    }



    abstract fun getNewBeanDao(): NewBeanDao

    abstract fun getNewBeanChildDao(): NewBeanChildDao
}