ccs.cdb
Class MKCDBObject

java.lang.Object
  extended by ccs.beetree.BeeObject
      extended by ccs.cdb.CDBObject
          extended by ccs.cdb.MKCDBObject
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CDBFileMeta

public abstract class MKCDBObject
extends CDBObject

Multipart-Key CDBObject. The key is composite and contains several fields in a well-defined order. This class parses and assembles the key. Note: all subclasses must be public, and all the key elements must be public, otherwise it won't work.

See Also:
Serialized Form

Field Summary
protected  java.lang.String[] keyfieldnames
          Subclass constructors must define this array, which references those fields that form the key.
 
Fields inherited from class ccs.cdb.CDBObject
clone, key, marshalVersion, owner
 
Fields inherited from class ccs.beetree.BeeObject
cipher, encodedLength, isBodiless, isForceDirectDecrypt, isZip, slack
 
Constructor Summary
MKCDBObject()
           
 
Method Summary
protected  java.lang.String cpgetKey()
          generates the key from the key fields.
protected  void cpsetKey(java.lang.String key)
          parses the key fields from the composite key.
 
Methods inherited from class ccs.cdb.CDBObject
canChangeKeyProgrammatically, canDeleteProgrammatically, canUpdateProgrammatically, cpgetMarshalledLength, cpmarshal, cppreMarshal, cppreUnmarshal, cpunmarshal, getCDB, getKey, getMarshalledLength, marshal, preMarshal, preUnmarshal, setCDB, setKey, transientMarshal, transientUnmarshal, unmarshal
 
Methods inherited from class ccs.beetree.BeeObject
lock, unlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keyfieldnames

protected java.lang.String[] keyfieldnames
Subclass constructors must define this array, which references those fields that form the key. NB. key fields must not contain the zero character '\0' since this is used as a field separator. (Trick: if you want exact matches on the fields you specify but accept whatever's in the DB for those you leave blank, explicitly add a "\0" to the last specified field (only) and then findFirst / nextMatch as normal. Without this "slug", you may get returns where the last specified field is longer than you specified.)

Constructor Detail

MKCDBObject

public MKCDBObject()
Method Detail

cpgetKey

protected final java.lang.String cpgetKey()
generates the key from the key fields. The composition stops if a field is blank (zero length); this allows partial-key matching.

Overrides:
cpgetKey in class CDBObject
Returns:
the composite key.

cpsetKey

protected final void cpsetKey(java.lang.String key)
parses the key fields from the composite key.

Overrides:
cpsetKey in class CDBObject
Parameters:
key - The composite key.