本文整理匯總了Java中com.squareup.sqlbrite.SqlBrite.wrapDatabaseHelper方法的典型用法代碼示例。如果您正苦於以下問題:Java SqlBrite.wrapDatabaseHelper方法的具體用法?Java SqlBrite.wrapDatabaseHelper怎麽用?Java SqlBrite.wrapDatabaseHelper使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.squareup.sqlbrite.SqlBrite
的用法示例。
在下文中一共展示了SqlBrite.wrapDatabaseHelper方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: Repository
import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
public Repository(Context context) {
SchedulerProvider schedulerProvider = DefaultSchedulerProvider.getInstance();
DbHelper openHelper = new DbHelper(context);
SqlBrite sqlBrite = new SqlBrite.Builder().build();
// TODO: switch to the rxjava2 scheduler when new sqlbrite will be released
BriteDatabase briteDatabase = sqlBrite.wrapDatabaseHelper(openHelper, Schedulers.io());
if (BuildConfig.DEBUG) {
briteDatabase.setLoggingEnabled(true);
}
briteDatabaseHelper = new BriteDatabaseHelper(briteDatabase);
Dependencies dependencies = new Dependencies(context, this, briteDatabaseHelper,
schedulerProvider);
artistRepository = new ArtistRepository(dependencies);
locationRepository = new LocationRepository(dependencies);
concertRepository = new ConcertRepository(dependencies);
syncStateRepository = new SyncStateRepository(dependencies);
syncRepository = new SyncRepository(dependencies);
}
示例2: provideDatabase
import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Provides
@Singleton
BriteDatabase provideDatabase(SqlBrite sqlBrite, SQLiteOpenHelper helper) {
BriteDatabase db = sqlBrite.wrapDatabaseHelper(helper, Schedulers.io());
db.setLoggingEnabled(true);
return db;
}
示例3: LocalAccountsDataSource
import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Inject
public LocalAccountsDataSource(@NonNull Context context, SchedulerProvider schedulerProvider) {
checkNotNull(context);
AccountsDbHelper accountsDbHelper = new AccountsDbHelper(context);
SqlBrite sqlBrite = SqlBrite.create();
this.accountsDbHelper = sqlBrite.wrapDatabaseHelper(accountsDbHelper, schedulerProvider.io());
accountMapperFunction = this::getAccount;
}
示例4: LimitCache
import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
LimitCache(Context context, Scheduler scheduler) {
SqlBrite sqlBrite = new SqlBrite.Builder().build();
LimitCacheSqlHelper helper = new LimitCacheSqlHelper(context);
db = sqlBrite.wrapDatabaseHelper(helper, scheduler);
SQLiteDatabase writableDatabase = db.getWritableDatabase();
put = new LimitCacheWay.Put(writableDatabase);
update = new LimitCacheWay.Update_way(writableDatabase);
cleanup = new LimitCacheWay.Cleanup(writableDatabase);
}
示例5: briteDatabase
import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
/**
* 提供BriteDatabase注入.
*
* @return BriteDatabase
*/
@Provides
BriteDatabase briteDatabase() {
SqlBrite sqlBrite = SqlBrite.create(message -> LogTool.debug("Database", message));
SQLiteOpenHelper sqLiteOpenHelper = new DatabaseOpenHelper(application, userId);
BriteDatabase db = sqlBrite.wrapDatabaseHelper(sqLiteOpenHelper);
db.setLoggingEnabled(BuildConfig.DEBUG);
return db;
}
示例6: onCreate
import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
iItems = new DataObserver(this);
queryAPI = ExcitedRetrofitFactory.getRetrofit(context).createApi(QueryAPI.class);
FavSQLiteHelper favSQLiteHelper = new FavSQLiteHelper(context);
SqlBrite sqlBrite = new SqlBrite.Builder().build();
db = sqlBrite.wrapDatabaseHelper(favSQLiteHelper, Schedulers.io());
}
示例7: providesBriteDatabase
import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Provides
@Singleton
BriteDatabase providesBriteDatabase(@ApplicationContext Context context){
SqlBrite sqlBrite = SqlBrite.create();
DBOpenHelper dbOpenHelper = new DBOpenHelper(context);
BriteDatabase db = sqlBrite.wrapDatabaseHelper(dbOpenHelper, Schedulers.io());
return db;
}
示例8: provideBriteDatabase
import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Provides
@Singleton
BriteDatabase provideBriteDatabase(SqlBrite sqlBrite, SQLiteOpenHelper helper) {
BriteDatabase db = sqlBrite.wrapDatabaseHelper(helper, Schedulers.io());
db.setLoggingEnabled(true);
return db;
}
示例9: provideBrite
import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Provides
@Singleton
BriteDatabase provideBrite(Context c, SchedulersProvider schedulers) {
SqlBrite sqlBrite = SqlBrite.create();
PisaBikeDbHelper helper = new PisaBikeDbHelper(c);
return sqlBrite.wrapDatabaseHelper(helper.getDbHelper(),
schedulers.provideBackgroundScheduler());
}
示例10: provideSqlBrite
import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Provides @Singleton BriteDatabase provideSqlBrite(SQLiteOpenHelper openHelper) {
SqlBrite sqlBrite = SqlBrite.create(new SqlBrite.Logger() {
@Override public void log(String message) {
Timber.tag("Database").v(message);
}
});
BriteDatabase db = sqlBrite.wrapDatabaseHelper(openHelper);
if (BuildConfig.DEBUG) {
db.setLoggingEnabled(true);
}
return db;
}
示例11: Database
import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Inject
public Database(final GeraltWomenSqliteOpenHelper helper) {
final SqlBrite sqlBrite = new SqlBrite.Builder().build();
this.briteDatabase = sqlBrite.wrapDatabaseHelper(helper, Schedulers.io());
}
示例12: provideBriteDatabase
import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Provides @Singleton BriteDatabase provideBriteDatabase(SqlBrite sqlBrite, SQLiteOpenHelper helper) {
return sqlBrite.wrapDatabaseHelper(helper, Schedulers.immediate());
}
示例13: provideDatabase
import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Provides
@NonNull
@Singleton
public BriteDatabase provideDatabase(SqlBrite sqlBrite, Database helper) {
return sqlBrite.wrapDatabaseHelper(helper, Schedulers.io());
}
示例14: provideBriteDatabase
import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Provides @Singleton BriteDatabase provideBriteDatabase(SqlBrite sqlBrite, SQLiteOpenHelper helper) {
return sqlBrite.wrapDatabaseHelper(helper);
}
示例15: provideDatabase
import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Provides @Singleton
public BriteDatabase provideDatabase(SqlBrite sqlBrite,MovieDatabaseHelper databaseHelper){
BriteDatabase db = sqlBrite.wrapDatabaseHelper(databaseHelper,Schedulers.io());
db.setLoggingEnabled(true);
return db;
}