Updated to new Depot world order.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5625 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2009-01-08 02:10:25 +00:00
parent 09850202a8
commit 991b9a9ffc
4 changed files with 15 additions and 65 deletions
@@ -35,33 +35,11 @@ import com.samskivert.depot.expression.ColumnExp;
public class ConfigRecord extends PersistentRecord
{
// AUTO-GENERATED: FIELDS START
/** The column identifier for the {@link #node} field. */
public static final String NODE = "node";
/** The qualified column identifier for the {@link #node} field. */
public static final ColumnExp NODE_C =
new ColumnExp(ConfigRecord.class, NODE);
/** The column identifier for the {@link #object} field. */
public static final String OBJECT = "object";
/** The qualified column identifier for the {@link #object} field. */
public static final ColumnExp OBJECT_C =
new ColumnExp(ConfigRecord.class, OBJECT);
/** The column identifier for the {@link #field} field. */
public static final String FIELD = "field";
/** The qualified column identifier for the {@link #field} field. */
public static final ColumnExp FIELD_C =
new ColumnExp(ConfigRecord.class, FIELD);
/** The column identifier for the {@link #value} field. */
public static final String VALUE = "value";
/** The qualified column identifier for the {@link #value} field. */
public static final ColumnExp VALUE_C =
new ColumnExp(ConfigRecord.class, VALUE);
public static final Class<ConfigRecord> _R = ConfigRecord.class;
public static final ColumnExp NODE = colexp(_R, "node");
public static final ColumnExp OBJECT = colexp(_R, "object");
public static final ColumnExp FIELD = colexp(_R, "field");
public static final ColumnExp VALUE = colexp(_R, "value");
// AUTO-GENERATED: FIELDS END
public static final int SCHEMA_VERSION = 2;
@@ -107,7 +85,7 @@ public class ConfigRecord extends PersistentRecord
{
return new Key<ConfigRecord>(
ConfigRecord.class,
new String[] { NODE, OBJECT, FIELD },
new ColumnExp[] { NODE, OBJECT, FIELD },
new Comparable[] { node, object, field });
}
// AUTO-GENERATED: METHODS END
@@ -50,7 +50,7 @@ public class ConfigRepository extends DepotRepository
public HashMap<String, String> loadConfig (String node, String object)
{
HashMap<String, String> data = new HashMap<String, String>();
Where where = new Where(ConfigRecord.OBJECT_C, object, ConfigRecord.NODE_C, node);
Where where = new Where(ConfigRecord.OBJECT, object, ConfigRecord.NODE, node);
for (ConfigRecord record : findAll(ConfigRecord.class, where)) {
data.put(record.field, record.value);
}