當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。