Document index use.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4808 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Par Winzell
2007-08-07 18:11:30 +00:00
parent a6be47fa83
commit 1eda45d8c8
3 changed files with 4 additions and 3 deletions
@@ -67,11 +67,10 @@ public class ConfigRecord extends PersistentRecord
@Column(name="NODE", length=64)
public String node;
/** The code of the stat. */
@Id
@Column(name="OBJECT", length=128)
public String object;
@Id
@Column(name="FIELD", length=64)
public String field;
@@ -52,6 +52,7 @@ public class ConfigRepository extends DepotRepository
throws PersistenceException
{
HashMap<String,String> data = new HashMap<String,String>();
// INDEX: Left-most primary key fields.
Where where = new Where(ConfigRecord.OBJECT_C, object, ConfigRecord.NODE_C, node);
for (ConfigRecord record : findAll(ConfigRecord.class, where)) {
data.put(record.field, record.value.toString());
@@ -80,9 +80,10 @@ public class NodeRepository extends DepotRepository
public void deleteNode (String nodeName)
throws PersistenceException
{
// INDEX: Full primary key.
delete(NodeRecord.class, nodeName);
}
@Override // from DepotRepository
protected void getManagedRecords (Set<Class<? extends PersistentRecord>> classes)
{