mirror of https://github.com/tasks/tasks
Removed task to tags table and started refactor to use metadata table (compilation errors)
parent
7b244da3b9
commit
58e1bdc455
@ -1,76 +0,0 @@
|
||||
package com.todoroo.astrid.data;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.net.Uri;
|
||||
|
||||
import com.todoroo.andlib.data.AbstractModel;
|
||||
import com.todoroo.andlib.data.Property;
|
||||
import com.todoroo.andlib.data.Property.LongProperty;
|
||||
import com.todoroo.andlib.data.Table;
|
||||
import com.todoroo.astrid.api.AstridApiConstants;
|
||||
|
||||
@SuppressWarnings("nls")
|
||||
public class TaskToTag extends AbstractModel {
|
||||
|
||||
/** table for this model */
|
||||
public static final Table TABLE = new Table("tasks_to_tags", TaskToTag.class);
|
||||
|
||||
/** content uri for this model */
|
||||
public static final Uri CONTENT_URI = Uri.parse("content://" + AstridApiConstants.PACKAGE + "/" +
|
||||
TABLE.name);
|
||||
|
||||
// --- properties
|
||||
|
||||
/** ID */
|
||||
public static final LongProperty ID = new LongProperty(
|
||||
TABLE, ID_PROPERTY_NAME);
|
||||
|
||||
public static final LongProperty TASK_ID = new LongProperty(
|
||||
TABLE, "taskId");
|
||||
|
||||
public static final LongProperty TASK_REMOTEID= new LongProperty(
|
||||
TABLE, "taskUuid");
|
||||
|
||||
public static final LongProperty TAG_ID = new LongProperty(
|
||||
TABLE, "tagId");
|
||||
|
||||
public static final LongProperty TAG_REMOTEID = new LongProperty(
|
||||
TABLE, "tagUuid");
|
||||
|
||||
public static final LongProperty DELETED_AT = new LongProperty(
|
||||
TABLE, "deletedAt");
|
||||
|
||||
public static final LongProperty PUSHED_AT = new LongProperty(
|
||||
TABLE, "pushedAt");
|
||||
|
||||
/** List of all properties for this model */
|
||||
public static final Property<?>[] PROPERTIES = generateProperties(TaskToTag.class);
|
||||
|
||||
/** Default values container */
|
||||
private static final ContentValues defaultValues = new ContentValues();
|
||||
|
||||
static {
|
||||
defaultValues.put(DELETED_AT.name, 0L);
|
||||
defaultValues.put(PUSHED_AT.name, 0L);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContentValues getDefaultValues() {
|
||||
return defaultValues;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getId() {
|
||||
return getIdHelper(ID);
|
||||
};
|
||||
|
||||
// --- parcelable helpers
|
||||
|
||||
private static final Creator<TaskToTag> CREATOR = new ModelCreator<TaskToTag>(TaskToTag.class);
|
||||
|
||||
@Override
|
||||
protected Creator<? extends AbstractModel> getCreator() {
|
||||
return CREATOR;
|
||||
}
|
||||
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package com.todoroo.astrid.dao;
|
||||
|
||||
import com.todoroo.andlib.data.DatabaseDao;
|
||||
import com.todoroo.andlib.service.Autowired;
|
||||
import com.todoroo.andlib.service.DependencyInjectionService;
|
||||
import com.todoroo.astrid.data.TaskToTag;
|
||||
|
||||
public class TaskToTagDao extends DatabaseDao<TaskToTag> {
|
||||
|
||||
@Autowired
|
||||
private Database database;
|
||||
|
||||
public TaskToTagDao() {
|
||||
super(TaskToTag.class);
|
||||
DependencyInjectionService.getInstance().inject(this);
|
||||
setDatabase(database);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue