• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java InsertQuery类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中com.pushtorefresh.storio.sqlite.queries.InsertQuery的典型用法代码示例。如果您正苦于以下问题:Java InsertQuery类的具体用法?Java InsertQuery怎么用?Java InsertQuery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

InsertQuery类属于com.pushtorefresh.storio.sqlite.queries包,在下文中一共展示了InsertQuery类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: shouldPassArgsToInsertWithOnConflict

点赞 3

import com.pushtorefresh.storio.sqlite.queries.InsertQuery; //导入依赖的package包/类
@Test
public void shouldPassArgsToInsertWithOnConflict() {
    SQLiteOpenHelper sqLiteOpenHelper = mock(SQLiteOpenHelper.class);
    SQLiteDatabase sqLiteDatabase = mock(SQLiteDatabase.class);
    when(sqLiteOpenHelper.getWritableDatabase("password")).thenReturn(sqLiteDatabase);
    StorIOSQLite storIOSQLite = CipherStoreIO.builder()
            .sqliteOpenHelper(sqLiteOpenHelper, "password")
            .build();
    InsertQuery insertQuery = InsertQuery.builder()
            .table("test_table")
            .nullColumnHack("custom_null_hack")
            .build();
    ContentValues contentValues = mock(ContentValues.class);
    int conflictAlgorithm = SQLiteDatabase.CONFLICT_ROLLBACK;
    storIOSQLite.lowLevel().insertWithOnConflict(insertQuery, contentValues, conflictAlgorithm);
    verify(sqLiteDatabase).insertWithOnConflict(
            eq("test_table"),
            eq("custom_null_hack"),
            same(contentValues),
            eq(SQLiteDatabase.CONFLICT_ROLLBACK)
    );
}
 

开发者ID:pbochenski,
项目名称:CipherStorIO,
代码行数:23,
代码来源:CipherStoreIOTest.java

示例2: mapToInsertQuery

点赞 2

import com.pushtorefresh.storio.sqlite.queries.InsertQuery; //导入依赖的package包/类
@NonNull
@Override
protected InsertQuery mapToInsertQuery(@NonNull final TranslatePhrase object) {
    return InsertQuery.builder()
            .table(TranslatePhraseTableMeta.TABLE_NAME)
            .build();
}
 

开发者ID:VDenis,
项目名称:YandexTranslator,
代码行数:8,
代码来源:DatabaseContract.java

示例3: mapToInsertQuery

点赞 2

import com.pushtorefresh.storio.sqlite.queries.InsertQuery; //导入依赖的package包/类
@NonNull
@Override
protected InsertQuery mapToInsertQuery(@NonNull StockUpdate object) {
    return InsertQuery.builder()
            .table(StockUpdateTable.TABLE)
            .build();
}
 

开发者ID:PacktPublishing,
项目名称:Reactive-Android-Programming,
代码行数:8,
代码来源:StockUpdatePutResolver.java

示例4: mapToInsertQuery

点赞 2

import com.pushtorefresh.storio.sqlite.queries.InsertQuery; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
@NonNull
public InsertQuery mapToInsertQuery(@NonNull Device object) {
    return InsertQuery.builder()
            .table("devices")
            .build();
}
 

开发者ID:erlymon,
项目名称:erlymon-monitor-android,
代码行数:11,
代码来源:DevicesTable.java

示例5: mapToInsertQuery

点赞 2

import com.pushtorefresh.storio.sqlite.queries.InsertQuery; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
@NonNull
public InsertQuery mapToInsertQuery(@NonNull Position object) {
    return InsertQuery.builder()
            .table("positions")
            .build();
}
 

开发者ID:erlymon,
项目名称:erlymon-monitor-android,
代码行数:11,
代码来源:PositionsTable.java

示例6: insert

点赞 2

import com.pushtorefresh.storio.sqlite.queries.InsertQuery; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@WorkerThread
@Override
public long insert(@NonNull InsertQuery insertQuery, @NonNull ContentValues contentValues) {
    return sqLiteOpenHelper
            .getWritableDatabase(password)
            .insertOrThrow(
                    insertQuery.table(),
                    insertQuery.nullColumnHack(),
                    contentValues
            );
}
 

开发者ID:pbochenski,
项目名称:CipherStorIO,
代码行数:15,
代码来源:CipherStoreIO.java

示例7: insertWithOnConflict

点赞 2

import com.pushtorefresh.storio.sqlite.queries.InsertQuery; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@WorkerThread
@Override
public long insertWithOnConflict(@NonNull InsertQuery insertQuery, @NonNull ContentValues contentValues, int conflictAlgorithm) {
    return sqLiteOpenHelper
            .getWritableDatabase(password)
            .insertWithOnConflict(
                    insertQuery.table(),
                    insertQuery.nullColumnHack(),
                    contentValues,
                    conflictAlgorithm
            );
}
 

开发者ID:pbochenski,
项目名称:CipherStorIO,
代码行数:16,
代码来源:CipherStoreIO.java

示例8: mapToInsertQuery

点赞 2

import com.pushtorefresh.storio.sqlite.queries.InsertQuery; //导入依赖的package包/类
@NonNull @Override protected InsertQuery mapToInsertQuery(@NonNull Lesson object) {
  return InsertQuery.builder().table(LessonEntry.TABLE_NAME).build();
}
 

开发者ID:drymarev,
项目名称:rxbsuir,
代码行数:4,
代码来源:LessonStorIOSQLitePutResolver.java

示例9: mapToInsertQuery

点赞 2

import com.pushtorefresh.storio.sqlite.queries.InsertQuery; //导入依赖的package包/类
@NonNull @Override protected InsertQuery mapToInsertQuery(@NonNull Employee object) {
  return InsertQuery.builder().table(EmployeeEntry.TABLE_NAME).build();
}
 

开发者ID:drymarev,
项目名称:rxbsuir,
代码行数:4,
代码来源:EmployeeStorIOSQLitePutResolver.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)