package com.unis.model.room;

import android.content.Context;

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

import com.unis.model.login_log.LoginDao;
import com.unis.model.login_log.LoginLog;

/**
 * 数据库实例
 * 创建人: mQ
 * 创建时间: 2021/2/5 17:02
 */
@Database(entities = {
        LoginLog.class
}, version = 1)
public abstract class MyDB extends RoomDatabase {

    private static final String DB_NAME = "sxzcl";

    private static MyDB sMyDB;

    public static synchronized void init(Context context) {
        sMyDB = Room.databaseBuilder(context.getApplicationContext(), MyDB.class, DB_NAME)
                .build();
    }

    public static MyDB get() {
        return sMyDB;
    }

    public abstract LoginDao loginDao();

}

