mirror of https://github.com/tasks/tasks
Remove updates table
parent
7b540fa218
commit
b06aa552d4
@ -1,143 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2012 Todoroo Inc
|
||||
*
|
||||
* See the file "LICENSE" for the full license governing this code.
|
||||
*/
|
||||
package com.todoroo.astrid.data;
|
||||
|
||||
import android.content.ContentValues;
|
||||
|
||||
import com.todoroo.andlib.data.Property;
|
||||
import com.todoroo.andlib.data.Property.LongProperty;
|
||||
import com.todoroo.andlib.data.Property.StringProperty;
|
||||
import com.todoroo.andlib.data.Table;
|
||||
import com.todoroo.andlib.data.TodorooCursor;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Data Model which represents an update (e.g. a comment or data update event)
|
||||
*
|
||||
* @author Tim Su <tim@todoroo.com>
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public class Update extends RemoteModel {
|
||||
|
||||
// --- table
|
||||
|
||||
/** table for this model */
|
||||
public static final Table TABLE = new Table("updates", Update.class);
|
||||
|
||||
// --- properties
|
||||
|
||||
/** ID */
|
||||
public static final LongProperty ID = new LongProperty(
|
||||
TABLE, ID_PROPERTY_NAME);
|
||||
|
||||
/** Remote ID */
|
||||
public static final LongProperty REMOTE_ID = new LongProperty(
|
||||
TABLE, UUID_PROPERTY_NAME);
|
||||
|
||||
/** Associated Task remote-id (if any) */
|
||||
public static final LongProperty TASK = new LongProperty(
|
||||
TABLE, "task");
|
||||
|
||||
/** Associated Task local-id (if any) */
|
||||
public static final LongProperty TASK_LOCAL = new LongProperty(
|
||||
TABLE, "taskLocal");
|
||||
|
||||
/** Associated Tag remote-ids (comma separated list with leading and trailing commas) */
|
||||
public static final StringProperty TAGS = new StringProperty(
|
||||
TABLE, "tag");
|
||||
|
||||
/** Associated Tag local-ids (comma separated list with leading and trailing commas) */
|
||||
public static final StringProperty TAGS_LOCAL = new StringProperty(
|
||||
TABLE, "tagsLocal");
|
||||
|
||||
/** From user id */
|
||||
public static final LongProperty USER_ID = new LongProperty(
|
||||
TABLE, USER_ID_PROPERTY_NAME);
|
||||
|
||||
/** From User Object (JSON) */
|
||||
public static final StringProperty USER = new StringProperty(
|
||||
TABLE, USER_JSON_PROPERTY_NAME);
|
||||
|
||||
/** Other user id */
|
||||
public static final LongProperty OTHER_USER_ID = new LongProperty(
|
||||
TABLE, "other_user_id");
|
||||
|
||||
/** Other User Object (JSON) */
|
||||
public static final StringProperty OTHER_USER = new StringProperty(
|
||||
TABLE, "other_user");
|
||||
|
||||
/** Action text */
|
||||
public static final StringProperty ACTION = new StringProperty(
|
||||
TABLE, "action");
|
||||
|
||||
/** Action code */
|
||||
public static final StringProperty ACTION_CODE = new StringProperty(
|
||||
TABLE, "actionCode");
|
||||
|
||||
/** Message */
|
||||
public static final StringProperty MESSAGE = new StringProperty(
|
||||
TABLE, "message");
|
||||
|
||||
/** Target Object Name */
|
||||
public static final StringProperty TARGET_NAME = new StringProperty(
|
||||
TABLE, "targetName");
|
||||
|
||||
/** From User Object (JSON) */
|
||||
public static final StringProperty PICTURE = new StringProperty(
|
||||
TABLE, "picture");
|
||||
|
||||
/** List of all properties for this model */
|
||||
public static final Property<?>[] PROPERTIES = generateProperties(Update.class);
|
||||
|
||||
// --- defaults
|
||||
|
||||
/** Default values container */
|
||||
private static final ContentValues defaultValues = new ContentValues();
|
||||
|
||||
@Override
|
||||
public ContentValues getDefaultValues() {
|
||||
return defaultValues;
|
||||
}
|
||||
|
||||
static {
|
||||
defaultValues.put(REMOTE_ID.name, 0);
|
||||
defaultValues.put(TASK.name, 0);
|
||||
defaultValues.put(TASK_LOCAL.name, 0);
|
||||
defaultValues.put(TAGS.name, "");
|
||||
defaultValues.put(TAGS_LOCAL.name, 0);
|
||||
defaultValues.put(USER_ID.name, 0);
|
||||
defaultValues.put(USER.name, "");
|
||||
defaultValues.put(OTHER_USER_ID.name, 0);
|
||||
defaultValues.put(OTHER_USER.name, "");
|
||||
defaultValues.put(ACTION.name, "");
|
||||
defaultValues.put(ACTION_CODE.name, "");
|
||||
defaultValues.put(MESSAGE.name, "");
|
||||
defaultValues.put(TARGET_NAME.name, "");
|
||||
defaultValues.put(PICTURE.name, "");
|
||||
}
|
||||
|
||||
// --- data access boilerplate
|
||||
|
||||
public Update() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Update(TodorooCursor<Update> cursor) {
|
||||
this();
|
||||
readPropertiesFromCursor(cursor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getId() {
|
||||
return getIdHelper(ID);
|
||||
}
|
||||
|
||||
// --- parcelable helpers
|
||||
|
||||
private static final Creator<Update> CREATOR = new ModelCreator<>(Update.class);
|
||||
}
|
||||
Loading…
Reference in New Issue