Make sure that pushed_at property is included in name maps, but don't record outstanding entries for it

pull/14/head
Sam Bosley 13 years ago
parent 742e53ea54
commit 3847e03774

@ -320,7 +320,7 @@ public class DatabaseDao<TYPE extends AbstractModel> {
Set<Entry<String, Object>> entries = modelSetValues.valueSet(); Set<Entry<String, Object>> entries = modelSetValues.valueSet();
long now = DateUtilities.now(); long now = DateUtilities.now();
for (Entry<String, Object> entry : entries) { for (Entry<String, Object> entry : entries) {
if (entry.getValue() != null && recordOutstandingEntry(entry.getKey())) { if (entry.getValue() != null && shouldRecordOutstandingEntry(entry.getKey())) {
AbstractModel m; AbstractModel m;
try { try {
m = outstandingTable.modelClass.newInstance(); m = outstandingTable.modelClass.newInstance();
@ -347,7 +347,7 @@ public class DatabaseDao<TYPE extends AbstractModel> {
* @param columnName * @param columnName
* @return * @return
*/ */
protected boolean recordOutstandingEntry(String columnName) { protected boolean shouldRecordOutstandingEntry(String columnName) {
return true; return true;
} }

@ -73,6 +73,7 @@ public class NameMaps {
putPropertyToServerName(Task.CREATOR_ID, "creator_id", TASK_PROPERTIES_LOCAL_TO_SERVER, TASK_COLUMNS_LOCAL_TO_SERVER); putPropertyToServerName(Task.CREATOR_ID, "creator_id", TASK_PROPERTIES_LOCAL_TO_SERVER, TASK_COLUMNS_LOCAL_TO_SERVER);
putPropertyToServerName(Task.UUID, "uuid", TASK_PROPERTIES_LOCAL_TO_SERVER, TASK_COLUMNS_LOCAL_TO_SERVER); putPropertyToServerName(Task.UUID, "uuid", TASK_PROPERTIES_LOCAL_TO_SERVER, TASK_COLUMNS_LOCAL_TO_SERVER);
putPropertyToServerName(Task.PROOF_TEXT, "proof_text", TASK_PROPERTIES_LOCAL_TO_SERVER, TASK_COLUMNS_LOCAL_TO_SERVER); putPropertyToServerName(Task.PROOF_TEXT, "proof_text", TASK_PROPERTIES_LOCAL_TO_SERVER, TASK_COLUMNS_LOCAL_TO_SERVER);
putPropertyToServerName(Task.PUSHED_AT, "pushed_at", TASK_PROPERTIES_LOCAL_TO_SERVER, TASK_COLUMNS_LOCAL_TO_SERVER);
TASK_PROPERTIES_SERVER_TO_LOCAL = AndroidUtilities.reverseMap(TASK_PROPERTIES_LOCAL_TO_SERVER); TASK_PROPERTIES_SERVER_TO_LOCAL = AndroidUtilities.reverseMap(TASK_PROPERTIES_LOCAL_TO_SERVER);
} }
@ -97,6 +98,7 @@ public class NameMaps {
putPropertyToServerName(TagData.UUID, "uuid", TAG_DATA_PROPERTIES_LOCAL_TO_SERVER, TAG_DATA_COLUMNS_LOCAL_TO_SERVER); putPropertyToServerName(TagData.UUID, "uuid", TAG_DATA_PROPERTIES_LOCAL_TO_SERVER, TAG_DATA_COLUMNS_LOCAL_TO_SERVER);
putPropertyToServerName(TagData.PROOF_TEXT, "proof_text", TAG_DATA_PROPERTIES_LOCAL_TO_SERVER, TAG_DATA_COLUMNS_LOCAL_TO_SERVER); putPropertyToServerName(TagData.PROOF_TEXT, "proof_text", TAG_DATA_PROPERTIES_LOCAL_TO_SERVER, TAG_DATA_COLUMNS_LOCAL_TO_SERVER);
putPropertyToServerName(TagData.TAG_ORDERING, "tag_ordering", TAG_DATA_PROPERTIES_LOCAL_TO_SERVER, TAG_DATA_COLUMNS_LOCAL_TO_SERVER); //TODO: NOT CORRECT putPropertyToServerName(TagData.TAG_ORDERING, "tag_ordering", TAG_DATA_PROPERTIES_LOCAL_TO_SERVER, TAG_DATA_COLUMNS_LOCAL_TO_SERVER); //TODO: NOT CORRECT
putPropertyToServerName(TagData.PUSHED_AT, "pushed_at", TAG_DATA_PROPERTIES_LOCAL_TO_SERVER, TAG_DATA_COLUMNS_LOCAL_TO_SERVER);
// Reverse the mapping to construct the server to local map // Reverse the mapping to construct the server to local map
TAG_DATA_PROPERTIES_SERVER_TO_LOCAL = AndroidUtilities.reverseMap(TAG_DATA_PROPERTIES_LOCAL_TO_SERVER); TAG_DATA_PROPERTIES_SERVER_TO_LOCAL = AndroidUtilities.reverseMap(TAG_DATA_PROPERTIES_LOCAL_TO_SERVER);

@ -31,10 +31,11 @@ public class TagDataDao extends RemoteModelDao<TagData> {
private static final String[] IGNORE_OUTSTANDING_COLUMNS = new String[] { private static final String[] IGNORE_OUTSTANDING_COLUMNS = new String[] {
TagData.MODIFICATION_DATE.name, TagData.MODIFICATION_DATE.name,
TagData.UUID.name, TagData.UUID.name,
TagData.PUSHED_AT.name,
}; };
@Override @Override
protected boolean recordOutstandingEntry(String columnName) { protected boolean shouldRecordOutstandingEntry(String columnName) {
return AndroidUtilities.indexOf(IGNORE_OUTSTANDING_COLUMNS, columnName) < 0; return AndroidUtilities.indexOf(IGNORE_OUTSTANDING_COLUMNS, columnName) < 0;
} }

@ -328,7 +328,7 @@ public class TaskDao extends RemoteModelDao<Task> {
}; };
@Override @Override
protected boolean recordOutstandingEntry(String columnName) { protected boolean shouldRecordOutstandingEntry(String columnName) {
return AndroidUtilities.indexOf(IGNORE_OUTSTANDING_COLUMNS, columnName) < 0; return AndroidUtilities.indexOf(IGNORE_OUTSTANDING_COLUMNS, columnName) < 0;
} }

Loading…
Cancel
Save