mirror of https://github.com/tasks/tasks
Made metadata have five value columns. Still to do: transition RTM to use metadata table
parent
cf75d057c1
commit
60d2157d06
@ -1,22 +0,0 @@
|
|||||||
package com.todoroo.astrid.dao;
|
|
||||||
|
|
||||||
import com.todoroo.andlib.data.Property.IntegerProperty;
|
|
||||||
import com.todoroo.astrid.model.Metadata;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper class for representing string columns from joined metadata
|
|
||||||
*/
|
|
||||||
public class IntegerJoinProperty extends IntegerProperty implements JoinProperty {
|
|
||||||
|
|
||||||
public IntegerJoinProperty(String name) {
|
|
||||||
super(null, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("nls")
|
|
||||||
public String joinTable() {
|
|
||||||
return String.format("SELECT %s,%s AS %s FROM %s WHERE %s='%s'",
|
|
||||||
Metadata.TASK, Metadata.VALUE, name,
|
|
||||||
Metadata.TABLE, Metadata.KEY, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
/**
|
|
||||||
* See the file "LICENSE" for the full license governing this code.
|
|
||||||
*/
|
|
||||||
package com.todoroo.astrid.dao;
|
|
||||||
|
|
||||||
public interface JoinProperty {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return SQL select statement describing how to load this property
|
|
||||||
* in a join statement
|
|
||||||
*/
|
|
||||||
public String joinTable();
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
package com.todoroo.astrid.dao;
|
|
||||||
|
|
||||||
import com.todoroo.andlib.data.Property.StringProperty;
|
|
||||||
import com.todoroo.astrid.model.Metadata;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper class for representing string columns from another table
|
|
||||||
*/
|
|
||||||
public class StringJoinProperty extends StringProperty implements JoinProperty {
|
|
||||||
|
|
||||||
public StringJoinProperty(String name) {
|
|
||||||
super(null, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("nls")
|
|
||||||
public String joinTable() {
|
|
||||||
return String.format("SELECT %s,%s AS %s FROM %s WHERE %s='%s'",
|
|
||||||
Metadata.TASK, Metadata.VALUE, name,
|
|
||||||
Metadata.TABLE, Metadata.KEY, name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue