@Override protected void fetchGlobalIds(ContentResolver resolver) { setGlobalIdCommunity( Entity.getGlobalId(Communities.CONTENT_URI, communityId, Communities.GLOBAL_ID, resolver)); setGlobalIdOwner(Entity.getGlobalId(People.CONTENT_URI, ownerId, People.GLOBAL_ID, resolver)); setGlobalIdService( Entity.getGlobalId(Services.CONTENT_URI, serviceId, Services.GLOBAL_ID, resolver)); }
@Override protected void populate(Cursor cursor) { super.populate(cursor); setId(Entity.getLong(cursor, _ID)); setGlobalId(Entity.getString(cursor, GLOBAL_ID)); setServiceId(Entity.getLong(cursor, _ID_SERVICE)); setOwnerId(Entity.getLong(cursor, _ID_OWNER)); setCommunityId(Entity.getLong(cursor, _ID_COMMUNITY)); setType(Entity.getString(cursor, TYPE)); setCreationDate(Entity.getLong(cursor, CREATION_DATE)); setLastModifiedDate(Entity.getLong(cursor, LAST_MODIFIED_DATE)); }
/** * Gets a list of all the "dirty" sharings. * * @param resolver The content resolver. * @return A list of updated sharings. * @throws Exception If an error occurs while fetching. */ public static List<Sharing> getUpdatedSharings(ContentResolver resolver) throws Exception { List<Sharing> sharings = Entity.getEntities(Sharing.class, resolver, CONTENT_URI, null, DIRTY + " = 1", null, null); for (Sharing sharing : sharings) sharing.fetchGlobalIds(resolver); return sharings; }
@Override public void fetchLocalId(ContentResolver resolver) { setId(Entity.getLocalId(CONTENT_URI, _ID, GLOBAL_ID, globalId, resolver)); setServiceId( Entity.getLocalId( Services.CONTENT_URI, Services._ID, Services.GLOBAL_ID, globalIdService, resolver)); setOwnerId( Entity.getLocalId( People.CONTENT_URI, People._ID, People.GLOBAL_ID, globalIdOwner, resolver)); setCommunityId( Entity.getLocalId( Communities.CONTENT_URI, Communities._ID, Communities.GLOBAL_ID, globalIdCommunity, resolver)); }