Search code examples
androidandroid-cursorgreendao

Is there a way to get a Cursor from a GreenDao Query object?


I'm trying to implement an AlphabtIndexer and the constructor requires a Cursor to the table in the DB.

is there a way to get a Cursor back from a Query object in GreenDao?


Solution

  • Assume you have Query object query and dao sesssion daoSession you can run:

    Cursor cursor = daoSession.getDatabase().rawQuery(query.getSql(), query.getParameters());