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