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);
}
Aggregations