Search in sources :

Example 1 with CursorIterator

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

the class QuantumFlux method findAll.

public static <T> Iterator<T> findAll(Class<T> dataModel) {
    TableDetails tableDetails = findTableDetails(dataModel);
    Uri itemUri = UriMatcherHelper.generateItemUriBuilder(tableDetails).build();
    ContentResolver contentResolver = mApplicationContext.getContentResolver();
    Cursor cursor = contentResolver.query(itemUri, null, null, null, null);
    return new CursorIterator<T>(tableDetails, cursor);
}
Also used : TableDetails(me.himanshusoni.quantumflux.model.generate.TableDetails) CursorIterator(me.himanshusoni.quantumflux.model.util.CursorIterator) Cursor(android.database.Cursor) Uri(android.net.Uri) ContentResolver(android.content.ContentResolver)

Aggregations

ContentResolver (android.content.ContentResolver)1 Cursor (android.database.Cursor)1 Uri (android.net.Uri)1 TableDetails (me.himanshusoni.quantumflux.model.generate.TableDetails)1 CursorIterator (me.himanshusoni.quantumflux.model.util.CursorIterator)1