Cumulus4j API
(1.2.0)

org.cumulus4j.store.model
Class IndexEntryObjectRelationHelper

java.lang.Object
  extended by org.cumulus4j.store.model.IndexEntryObjectRelationHelper

public class IndexEntryObjectRelationHelper
extends Object

Helper to find an IndexEntry for an object relation (1-1, 1-n or m-n). Even though DefaultIndexEntryFactory and IndexEntryLong are used for such relations, these classes should not be directly accessed in order to make refactorings easier (if this class is used for all object relations, it is possible to search for references of this class).

Author:
Marco หงุ่ยตระกูล-Schulze - marco at nightlabs dot de

Constructor Summary
IndexEntryObjectRelationHelper()
           
 
Method Summary
static IndexEntry createIndexEntry(CryptoContext cryptoContext, PersistenceManager pmIndex, FieldMeta fieldMeta, ClassMeta classMeta, Long indexedDataEntryID)
          Get an existing IndexEntry or create it, if it does not yet exist.
static List<IndexEntry> getIndexEntries(CryptoContext cryptoContext, PersistenceManager pmIndex, FieldMeta fieldMeta, List<ClassMeta> classMetas, Long indexedDataEntryID)
           
static List<IndexEntry> getIndexEntriesIncludingSubClasses(CryptoContext cryptoContext, PersistenceManager pmIndex, FieldMeta fieldMeta, ClassMeta classMeta, Long indexedDataEntryID)
           
static IndexEntry getIndexEntry(CryptoContext cryptoContext, PersistenceManager pmIndex, FieldMeta fieldMeta, ClassMeta classMeta, Long indexedDataEntryID)
          Get an existing IndexEntry or null, if it does not exist.
static IndexEntryFactory getIndexEntryFactory()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexEntryObjectRelationHelper

public IndexEntryObjectRelationHelper()
Method Detail

getIndexEntryFactory

public static IndexEntryFactory getIndexEntryFactory()

getIndexEntriesIncludingSubClasses

public static List<IndexEntry> getIndexEntriesIncludingSubClasses(CryptoContext cryptoContext,
                                                                  PersistenceManager pmIndex,
                                                                  FieldMeta fieldMeta,
                                                                  ClassMeta classMeta,
                                                                  Long indexedDataEntryID)

getIndexEntries

public static List<IndexEntry> getIndexEntries(CryptoContext cryptoContext,
                                               PersistenceManager pmIndex,
                                               FieldMeta fieldMeta,
                                               List<ClassMeta> classMetas,
                                               Long indexedDataEntryID)

getIndexEntry

public static IndexEntry getIndexEntry(CryptoContext cryptoContext,
                                       PersistenceManager pmIndex,
                                       FieldMeta fieldMeta,
                                       ClassMeta classMeta,
                                       Long indexedDataEntryID)
Get an existing IndexEntry or null, if it does not exist. This method looks up an IndexEntry for a relation to the object referenced by the given indexedDataEntryID and the relation-type specified by the given fieldMeta.

Parameters:
cryptoContext - the crypto-context.
pmIndex - the backend-PersistenceManager used to access the index-datastore.
fieldMeta - the field pointing to the referenced object.
classMeta - the concrete owner type holding the field (might be a sub-class of fieldMeta.classMeta.
indexedDataEntryID - the DataEntry.dataEntryID of the referenced object.
Returns:
the appropriate IndexEntry or null.

createIndexEntry

public static IndexEntry createIndexEntry(CryptoContext cryptoContext,
                                          PersistenceManager pmIndex,
                                          FieldMeta fieldMeta,
                                          ClassMeta classMeta,
                                          Long indexedDataEntryID)
Get an existing IndexEntry or create it, if it does not yet exist. This method behaves just like getIndexEntry(CryptoContext, PersistenceManager, FieldMeta, ClassMeta, Long), but instead of returning null, it creates an IndexEntry, if it does not yet exist.

Parameters:
cryptoContext - the crypto-context.
pmIndex - the backend-PersistenceManager used to access the index-datastore.
fieldMeta - the field pointing to the referenced object.
classMeta - the concrete owner type holding the field (might be a sub-class of fieldMeta.classMeta.
indexedDataEntryID - the DataEntry.dataEntryID of the referenced object.
Returns:
the appropriate IndexEntry; never null.

Cumulus4j API
(1.2.0)

Copyright © 2013 NightLabs Consulting GmbH. All Rights Reserved.