|
Cumulus4j API (1.0.1) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.cumulus4j.store.model.IndexEntry
public abstract class IndexEntry
Persistent index information with encrypted pointers to DataEntry
s.
Since the index is type-specific, there are sub-classes for each data type. One
IndexEntry
instance is used for each distinct value of one certain field.
Therefore, the field (represented by the property fieldMeta
)
and the value together form a unique key of IndexEntry
- thus the value
is represented by the property indexKey
.
Example:
// persistent class: @PersistenceCapable class Person { public Person(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } private String firstName; private String lastName; // ... } class SomeTest { @Test public void persistPersons() { pm.makePersistent(new Person("Alice", "Müller")); pm.makePersistent(new Person("Alice", "Meier")); } }
After running this test, there would be three instances of IndexEntryStringShort
in the database
indexing the values "Alice", "Müller" and "Meier". Note, that "Alice" occurs only once in the index, even though
there are two Person
instances using it. The two persons would be referenced from the one index-entry
via getIndexValue()
.
Constructor Summary | |
---|---|
IndexEntry()
|
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
FieldMeta |
getFieldMeta()
Get the descriptor of the indexed field. |
long |
getIndexEntryID()
Get the single primary key field (= object-identifier) of this IndexEntry . |
abstract Object |
getIndexKey()
Get the value which is indexed by this instance. |
byte[] |
getIndexValue()
Get the encrypted pointers to DataEntry . |
long |
getKeyID()
Get the identifier of the encryption-key used to encrypt the indexValue . |
int |
hashCode()
|
void |
jdoPreStore()
|
protected void |
setFieldMeta(FieldMeta fieldMeta)
|
protected abstract void |
setIndexKey(Object indexKey)
|
void |
setIndexValue(byte[] indexValue)
|
void |
setKeyID(long keyID)
Set the identifier of the encryption-key used to encrypt the indexValue . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IndexEntry()
Method Detail |
---|
public long getIndexEntryID()
IndexEntry
.
public FieldMeta getFieldMeta()
Get the descriptor of the indexed field.
Every IndexEntry
instance belongs to one field or a part of the field (e.g. a Map
's key).
protected void setFieldMeta(FieldMeta fieldMeta)
public abstract Object getIndexKey()
fieldMeta
.
protected abstract void setIndexKey(Object indexKey)
public long getKeyID()
indexValue
.
IndexEntry
's contents.setKeyID(long)
public void setKeyID(long keyID)
indexValue
.
keyID
- the encryption-key used to encrypt this IndexEntry
's contents.getKeyID()
public byte[] getIndexValue()
DataEntry
. After decrypting
this byte array, you can pass it to IndexValue.IndexValue(byte[])
.
DataEntry
s.public void setIndexValue(byte[] indexValue)
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public void jdoPreStore()
jdoPreStore
in interface StoreCallback
|
Cumulus4j API (1.0.1) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |