package com.example.applock.roombase;

import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;

import com.example.applock.value.MyAllValues;

@Database(
        entities = {AppEntity.class},
        version = MyAllValues.DBVersion,
        exportSchema = false
)
public abstract class AppDataBase extends RoomDatabase {
    private static AppDataBase appDataBaseInstance;

    public abstract AppEntityDao getAppEntityDao();
    public static synchronized AppDataBase getDatabaseInstance(){
        if(appDataBaseInstance == null){
            appDataBaseInstance = Room.databaseBuilder(MyAllValues.softWareLockApplication,AppDataBase.class,MyAllValues.DBName).build();
        }
        return appDataBaseInstance;
    }
    }
