| 
 | Cumulus4j API (1.1.0) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cumulus4j.store.model.IndexEntry
public abstract class IndexEntry
 Persistent index information with encrypted pointers to DataEntrys.
 
 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) | 
|  ClassMeta | getClassMeta()Get the ClassMetaof the concrete type of the instance containing the field. | 
|  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 | getKeyStoreRefID()Get the numeric identifier of the key store. | 
| protected  PersistenceManager | getPersistenceManager() | 
|  int | hashCode() | 
|  void | jdoPreStore() | 
|  void | setClassMeta(ClassMeta classMeta) | 
| 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. | 
|  void | setKeyStoreRefID(int keyStoreRefID)Set the numeric identifier of the key store. | 
| 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 ClassMeta getClassMeta()
ClassMeta of the concrete type of the instance containing the field.
 If a field is declared in a super-class, all sub-classes have it, too. But when querying instances of a sub-class (either as candidate-class or in a relation (as concrete type of the field/property), only this given sub-class and its sub-classes should be found.
 The ClassMeta here is either the same as fieldMeta.classMeta
 (if it is an instance of the class declaring the field) or a ClassMeta of a sub-class of
 fieldMeta.classMeta.
ClassMeta of the concrete type of the instance containing the field.protected PersistenceManager getPersistenceManager()
public void setClassMeta(ClassMeta classMeta)
public int getKeyStoreRefID()
KeyStoreRef instances.
public void setKeyStoreRefID(int keyStoreRefID)
keyStoreRefID - the numeric identifier of the key store.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[]).
DataEntrys.public void setIndexValue(byte[] indexValue)
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic void jdoPreStore()
jdoPreStore in interface StoreCallback| 
 | Cumulus4j API (1.1.0) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||