示例#1
0
 /**
  * Get the local id
  *
  * @param uuid
  * @return
  */
 public long localIdFromUuid(String uuid) {
   TodorooCursor<RTYPE> cursor =
       query(Query.select(AbstractModel.ID_PROPERTY).where(RemoteModel.UUID_PROPERTY.eq(uuid)));
   try {
     if (cursor.getCount() == 0) return AbstractModel.NO_ID;
     cursor.moveToFirst();
     return cursor.get(AbstractModel.ID_PROPERTY);
   } finally {
     cursor.close();
   }
 }
示例#2
0
 /** Fetch a model object by UUID */
 public TagData fetch(String uuid, Property<?>... properties) {
   return getFirst(Query.select(properties).where(RemoteModel.UUID_PROPERTY.eq(uuid)));
 }
示例#3
0
 /**
  * Returns cursor to object corresponding to the given identifier
  *
  * @param database
  * @param table name of table
  * @param properties properties to read
  * @param id id of item
  * @return
  */
 protected TodorooCursor<RTYPE> fetchItem(String uuid, Property<?>... properties) {
   TodorooCursor<RTYPE> cursor =
       query(Query.select(properties).where(RemoteModel.UUID_PROPERTY.eq(uuid)));
   cursor.moveToFirst();
   return new TodorooCursor<RTYPE>(cursor, properties);
 }