本文整理汇总了Java中android.arch.persistence.db.SupportSQLiteQuery类的典型用法代码示例。如果您正苦于以下问题:Java SupportSQLiteQuery类的具体用法?Java SupportSQLiteQuery怎么用?Java SupportSQLiteQuery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SupportSQLiteQuery类属于android.arch.persistence.db包,在下文中一共展示了SupportSQLiteQuery类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: query
import android.arch.persistence.db.SupportSQLiteQuery; //导入依赖的package包/类
@Override
public Cursor query(final SupportSQLiteQuery supportQuery) {
return mDelegate.rawQueryWithFactory((db, masterQuery, editTable, query) -> {
supportQuery.bindTo(new FrameworkSQLiteProgram(query));
return new SQLiteCursor(masterQuery, editTable, query);
}, supportQuery.getSql(), EMPTY_STRING_ARRAY, null);
}
示例2: query
import android.arch.persistence.db.SupportSQLiteQuery; //导入依赖的package包/类
/**
* Runs the provided SQL and returns a {@link Cursor} over the result set.
*
* @param supportQuery the SQL query. The SQL string must not be ; terminated
* @param signal A signal to cancel the operation in progress, or null if none.
* If the operation is canceled, then {@link OperationCanceledException} will be thrown
* when the query is executed.
* @return A {@link Cursor} object, which is positioned before the first entry. Note that
* {@link Cursor}s are not synchronized, see the documentation for more details.
*/
@Override
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
public Cursor query(SupportSQLiteQuery supportQuery, android.os.CancellationSignal signal) {
final CancellationSignal supportCancellationSignal = new CancellationSignal();
signal.setOnCancelListener(new android.os.CancellationSignal.OnCancelListener() {
@Override
public void onCancel() {
supportCancellationSignal.cancel();
}
});
return query(supportQuery, supportCancellationSignal);
}
示例3: query
import android.arch.persistence.db.SupportSQLiteQuery; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public Cursor query(final SupportSQLiteQuery supportQuery) {
return(query(supportQuery, null));
}
示例4: DatabaseQuery
import android.arch.persistence.db.SupportSQLiteQuery; //导入依赖的package包/类
DatabaseQuery(Iterable<String> tables, SupportSQLiteQuery query) {
this.tables = tables;
this.query = query;
}
示例5: query
import android.arch.persistence.db.SupportSQLiteQuery; //导入依赖的package包/类
@Override
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
public Cursor query(final SupportSQLiteQuery supportQuery,
CancellationSignal cancellationSignal) {
return query(supportQuery);
}
示例6: createQuery
import android.arch.persistence.db.SupportSQLiteQuery; //导入依赖的package包/类
/**
* Create an observable which will notify subscribers with a {@linkplain Query query} for
* execution. Subscribers are responsible for <b>always</b> closing {@link Cursor} instance
* returned from the {@link Query}.
* <p>
* Subscribers will receive an immediate notification for initial data as well as subsequent
* notifications for when the supplied {@code table}'s data changes through the {@code insert},
* {@code update}, and {@code delete} methods of this class. Unsubscribe when you no longer want
* updates to a query.
* <p>
* Since database triggers are inherently asynchronous, items emitted from the returned
* observable use the {@link Scheduler} supplied to {@link SqlBrite#wrapDatabaseHelper}. For
* consistency, the immediate notification sent on subscribe also uses this scheduler. As such,
* calling {@link Observable#subscribeOn subscribeOn} on the returned observable has no effect.
* <p>
* Note: To skip the immediate notification and only receive subsequent notifications when data
* has changed call {@code skip(1)} on the returned observable.
* <p>
* <b>Warning:</b> this method does not perform the query! Only by subscribing to the returned
* {@link Observable} will the operation occur.
*
* @see SupportSQLiteDatabase#query(SupportSQLiteQuery)
*/
@CheckResult @NonNull
public QueryObservable createQuery(@NonNull final String table,
@NonNull SupportSQLiteQuery query) {
return createQuery(new DatabaseQuery(singletonList(table), query));
}