Search in sources :

Example 1 with QuantumFluxCursor

use of me.himanshusoni.quantumflux.model.util.QuantumFluxCursor in project QuantumFlux by himanshu-soni.

the class Select method queryAsCursor.

/**
     * Executes the query and returns the results as a cursor. The {@link QuantumFluxCursor} is a wrapper for the normal cursor,
     * and in addition to providing the normal cursor functionality, it also has methods to manipulate model objects, such as inflating the current cursor
     * values to a model object.
     *
     * @return The {@link QuantumFluxCursor} containing the results
     */
public QuantumFluxCursor<T> queryAsCursor() {
    ContentResolverValues contentResolverValues = asContentResolverValue();
    ContentResolver contentResolver = QuantumFlux.getApplicationContext().getContentResolver();
    Cursor cursor = contentResolver.query(contentResolverValues.getItemUri(), contentResolverValues.getProjection(), contentResolverValues.getWhere(), contentResolverValues.getWhereArgs(), contentResolverValues.getSortOrder());
    return new QuantumFluxCursor<>(contentResolverValues.getTableDetails(), cursor);
}
Also used : ContentResolverValues(me.himanshusoni.quantumflux.model.util.ContentResolverValues) QuantumFluxCursor(me.himanshusoni.quantumflux.model.util.QuantumFluxCursor) QuantumFluxCursor(me.himanshusoni.quantumflux.model.util.QuantumFluxCursor) Cursor(android.database.Cursor) ContentResolver(android.content.ContentResolver)

Aggregations

ContentResolver (android.content.ContentResolver)1 Cursor (android.database.Cursor)1 ContentResolverValues (me.himanshusoni.quantumflux.model.util.ContentResolverValues)1 QuantumFluxCursor (me.himanshusoni.quantumflux.model.util.QuantumFluxCursor)1