Added field to track if data point has been reported

pull/14/head
Sam Bosley 12 years ago
parent bf15575643
commit 2a0200a715

@ -57,6 +57,7 @@ public class ABTestEventDao extends DatabaseDao<ABTestEvent> {
long now = DateUtilities.now();
for (int i = lastRecordedTimeIntervalIndex + 1; i <= currentTimeIntervalIndex; i++) {
item.clearValue(ABTestEvent.ID);
item.setValue(ABTestEvent.REPORTED, 0);
item.setValue(ABTestEvent.TIME_INTERVAL, ABTestEvent.TIME_INTERVALS[i]);
item.setValue(ABTestEvent.DATE_RECORDED, now);
createNew(item);

@ -84,14 +84,20 @@ public class ABTestEvent extends AbstractModel {
public static final LongProperty DATE_RECORDED = new LongProperty(
TABLE, "dateRecorded");
/** Whether or not this data point has been reported to the server */
public static final IntegerProperty REPORTED = new IntegerProperty(
TABLE, "reported"); // 0 if not yet reported, 1 if reported successfully
/** List of all properties for this model */
public static final Property<?>[] PROPERTIES = generateProperties(Task.class);
private static final ContentValues defaultValues = new ContentValues();
private static final ContentValues defaultValues = new ContentValues();
static {
// initialize with default values
defaultValues.put(REPORTED.name, 0);
}
@Override

Loading…
Cancel
Save