當前位置: 首頁>>代碼示例>>Java>>正文


Java SqlBrite.create方法代碼示例

本文整理匯總了Java中com.squareup.sqlbrite.SqlBrite.create方法的典型用法代碼示例。如果您正苦於以下問題:Java SqlBrite.create方法的具體用法?Java SqlBrite.create怎麽用?Java SqlBrite.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.squareup.sqlbrite.SqlBrite的用法示例。


在下文中一共展示了SqlBrite.create方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: provideSqlBrite

import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Provides
@Singleton
SqlBrite provideSqlBrite(SQLiteOpenHelper openHelper) {
    SqlBrite db = SqlBrite.create(openHelper);

    if (BuildConfig.DEBUG) {
        db.setLogger(new SqlBrite.Logger() {
            @Override
            public void log(String message) {
                Timber.tag("Database").v(message);
            }
        });
        db.setLoggingEnabled(true);
    }

    return db;
}
 
開發者ID:thanksmister,項目名稱:BitcoinBlue,代碼行數:18,代碼來源:DbModule.java

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: onCreate

import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.list_of_kittens_layout);
  listOfKittens = (RecyclerView) findViewById(R.id.list_of_kittens);
  floatingActionButton = (FloatingActionButton) findViewById(R.id.fab);
  floatingActionButton.setOnClickListener(this::addRandomKitten);
  sqlBrite = SqlBrite.create();
  kittenAdapter = new KittenAdapter(this);
  listOfKittens.setLayoutManager(new LinearLayoutManager(this));
  listOfKittens.setAdapter(kittenAdapter);
}
 
開發者ID:ErikHellman,項目名稱:RxJavaExplained,代碼行數:13,代碼來源:SqlbriteDemoActivity.java

示例7: provideSqlBrite

import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Provides @Singleton SqlBrite provideSqlBrite(SQLiteOpenHelper openHelper) {
  SqlBrite db = SqlBrite.create(openHelper);

  if (BuildConfig.DEBUG) {
    db.setLogger(new SqlBrite.Logger() {
      @Override public void log(String message) {
        Timber.tag("Database").v(message);
      }
    });
    db.setLoggingEnabled(true);
  }

  return db;
}
 
開發者ID:GerardPaligot,項目名稱:LearnIt,代碼行數:15,代碼來源:DatabaseModule.java

示例8: 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

示例9: provideSqlBrite

import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Provides
@Singleton
SqlBrite provideSqlBrite() {
    return SqlBrite.create(message -> Timber.tag("Database").v(message));
}
 
開發者ID:geralt-encore,項目名稱:Delightful-SQLBrite,代碼行數:6,代碼來源:DbModule.java

示例10: provideSqlBrite

import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Provides @Singleton SqlBrite provideSqlBrite() {
    return SqlBrite.create(Timber.tag(TAG)::v);
}
 
開發者ID:Nilhcem,項目名稱:droidconde-2016,代碼行數:4,代碼來源:DatabaseModule.java

示例11: provideSqlBrite

import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Provides
@NonNull
@Singleton
public SqlBrite provideSqlBrite() {
    return SqlBrite.create(message -> Timber.tag("Database").v(message));
}
 
開發者ID:NimbleDroid,項目名稱:FriendlyDemo,代碼行數:7,代碼來源:ApplicationModule.java

示例12: DaoManager

import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
private DaoManager(Builder builder) {

    if (builder.name == null) {
      throw new IllegalArgumentException(
          "Database name not set. Use Builder.databaseName() to specify a database name");
    }

    if (builder.version == -1) {
      throw new IllegalArgumentException(
          "Database version not set. Use Builder.version() to specify the database version");
    }

    if (builder.daos.isEmpty()) {
      throw new IllegalArgumentException(
          "No DAO added. Use Builder.add() to register at least one DAO");
    }

    this.name = builder.name;
    this.version = builder.version;
    this.createdListener = builder.createdListener;
    this.upgradedListener = builder.upgradedListener;
    this.daos = builder.daos;

    OpenHelper openHelper;
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
      openHelper = new OpenHelper(builder.context, name, builder.cursorFactory, version,
          builder.errorHandler, builder.foreignKeyConstraints);
    } else {
      openHelper = new OpenHelperApi16(builder.context, name, builder.cursorFactory, version,
          builder.errorHandler, builder.foreignKeyConstraints);
    }

    SqlBrite brite;
    if (builder.logger != null) {
      brite = SqlBrite.create(builder.logger);
    } else {
      brite = SqlBrite.create();
    }

    db = brite.wrapDatabaseHelper(openHelper,
        builder.scheduler == null ? Schedulers.io() : builder.scheduler);
    db.setLoggingEnabled(builder.logging);

    for (Dao dao : builder.daos) {
      dao.setSqlBriteDb(db);
    }
  }
 
開發者ID:sockeqwe,項目名稱:sqlbrite-dao,代碼行數:48,代碼來源:DaoManager.java

示例13: onAppCreate

import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Override
protected void onAppCreate(Context ctx) {
    SqlBrite mSqlBrite = SqlBrite.create(s -> JUtils.Log("DB",s));
    mDbBrite = mSqlBrite.wrapDatabaseHelper(new DBHelper(ctx));
}
 
開發者ID:Jude95,項目名稱:Fishing,代碼行數:6,代碼來源:PlaceModel.java

示例14: provideSqlBrite

import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Provides @Singleton
SqlBrite provideSqlBrite(SQLiteOpenHelper helper) {
    return SqlBrite.create(helper);
}
 
開發者ID:labhackercd,項目名稱:edm,代碼行數:5,代碼來源:DbModule.java

示例15: provideSqlBrite

import com.squareup.sqlbrite.SqlBrite; //導入方法依賴的package包/類
@Provides
@Singleton
SqlBrite provideSqlBrite() {
    return SqlBrite.create();
}
 
開發者ID:enviroCar,項目名稱:enviroCar-app,代碼行數:6,代碼來源:DatabaseModule.java


注:本文中的com.squareup.sqlbrite.SqlBrite.create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。