package cn.flightfeather.thirdapp.common.database;
|
|
import android.content.Context;
|
|
import cn.flightfeather.thirdapp.CommonApplication;
|
|
/**
|
* @author riku
|
* 连接当前使用的数据库
|
*/
|
// FIXME: 2019/3/27 by riku 目前代码中很多地方是直接使用Dao类来进行数据库操作,并且都是直接放在主线程中运行(无语),之后可能需要逐步集成到GreenDaoDb类中
|
public class DbLink {
|
public static DbSource getDbSource(CommonApplication application) {
|
//此处可替换不同的数据库实例,达到快速替换数据库的效果
|
return GreenDaoDb.getInstance(application);
|
}
|
|
public static DbSource getDbSource(Context context) {
|
//此处可替换不同的数据库实例,达到快速替换数据库的效果
|
return GreenDaoDb.getInstance(context);
|
}
|
}
|