@Override public Category fetch(long id) { Cursor cursor = query(getPrimaryKey() + "=" + id); if (cursor.moveToFirst()) { return CategoryFactory.fromCursor(cursor); } return null; }
@Override public CategoryCollection fetchAll() { CategoryCollection collection = new CategoryCollection(); Cursor cursor = query(null); if (cursor.moveToFirst()) { collection.add(CategoryFactory.fromCursor(cursor)); } return collection; }