vendredi 14 août 2015

sqlite returns no results

I'm under a wall. I have a very simple method

public List<com.fixus.portals.model.Foothold> findAll() {
    List<com.fixus.portals.model.Foothold> result = new ArrayList<com.fixus.portals.model.Foothold>();
    Cursor cursor = this.db.query(MainHelper.TABLE_FOOTHOLD, FOOTHOLD_FIELDS, null, null, null, null, null);

    cursor.moveToFirst();
    while (!cursor.isAfterLast()) {
        com.fixus.portals.model.Foothold foothold = this.mapToObject(cursor);
        result.add(foothold);
        cursor.moveToNext();
    }
    cursor.close();

    return result;

}

It should return every record from table but it returns 0 (zero). I don't know why. I've debugged whole process the query looks ok. What is funny when I copy the query that is invoked and run it manualy on DB i receive the results. But when I do it from Android level I return nothing. What am I doing wrong ?

Aucun commentaire:

Enregistrer un commentaire