当前位置: 首页>>代码示例>>Java>>正文


Java SqlBrite.wrapDatabaseHelper方法代码示例

本文整理汇总了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);
}
 
开发者ID:andreybgm,项目名称:gigreminder,代码行数:23,代码来源:Repository.java

示例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;
}
 
开发者ID:geralt-encore,项目名称:Delightful-SQLBrite,代码行数:8,代码来源:DbModule.java

示例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;
}
 
开发者ID:przemyslaw-holownia,项目名称:financial-manager,代码行数:10,代码来源:LocalAccountsDataSource.java

示例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);
}
 
开发者ID:plusCubed,项目名称:velociraptor,代码行数:11,代码来源:LimitCache.java

示例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;
}
 
开发者ID:iFarSeer,项目名称:TodoFluxArchitecture,代码行数:15,代码来源:StorageModule.java

示例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());
}
 
开发者ID:oxoooo,项目名称:excited-android,代码行数:10,代码来源:FavoritesFragment.java

示例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;
}
 
开发者ID:WassimBenltaief,项目名称:AndroidMvpBoilerplate,代码行数:9,代码来源:ApplicationModule.java

示例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;
}
 
开发者ID:TomeOkin,项目名称:LsPush,代码行数:8,代码来源:DataModule.java

示例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());
}
 
开发者ID:fedepaol,项目名称:BikeSharing,代码行数:9,代码来源:ApplicationModule.java

示例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;
}
 
开发者ID:GerardPaligot,项目名称:ZMessenger,代码行数:15,代码来源:DatabaseModule.java

示例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());
}
 
开发者ID:dmitrikudrenko,项目名称:MDRXL,代码行数:6,代码来源:Database.java

示例12: provideBriteDatabase

import com.squareup.sqlbrite.SqlBrite; //导入方法依赖的package包/类
@Provides @Singleton BriteDatabase provideBriteDatabase(SqlBrite sqlBrite, SQLiteOpenHelper helper) {
    return sqlBrite.wrapDatabaseHelper(helper, Schedulers.immediate());
}
 
开发者ID:Nilhcem,项目名称:droidconde-2016,代码行数:4,代码来源:DatabaseModule.java

示例13: provideDatabase

import com.squareup.sqlbrite.SqlBrite; //导入方法依赖的package包/类
@Provides
@NonNull
@Singleton
public BriteDatabase provideDatabase(SqlBrite sqlBrite, Database helper) {
    return sqlBrite.wrapDatabaseHelper(helper, Schedulers.io());
}
 
开发者ID:NimbleDroid,项目名称:FriendlyDemo,代码行数:7,代码来源:ApplicationModule.java

示例14: provideBriteDatabase

import com.squareup.sqlbrite.SqlBrite; //导入方法依赖的package包/类
@Provides @Singleton BriteDatabase provideBriteDatabase(SqlBrite sqlBrite, SQLiteOpenHelper helper) {
    return sqlBrite.wrapDatabaseHelper(helper);
}
 
开发者ID:Nilhcem,项目名称:droidcontn-2016,代码行数:4,代码来源:DatabaseModule.java

示例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;
}
 
开发者ID:Rashwan,项目名称:Reactive-Popular-Movies,代码行数:7,代码来源:ApplicationModule.java


注:本文中的com.squareup.sqlbrite.SqlBrite.wrapDatabaseHelper方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。