Cumulus4j API
(1.0.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(PersistenceManager pmIndex, FieldMeta fieldMeta, Long indexedDataEntryID)
          Get an existing IndexEntry or create it, if it does not yet exist.
static IndexEntry getIndexEntry(PersistenceManager pmIndex, FieldMeta fieldMeta, 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()

getIndexEntry

public static IndexEntry getIndexEntry(PersistenceManager pmIndex,
                                       FieldMeta fieldMeta,
                                       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:
pmIndex - the backend-PersistenceManager used to access the index-datastore.
fieldMeta - the field pointing to the referenced object.
indexedDataEntryID - the DataEntry.dataEntryID of the referenced object.
Returns:
the appropriate IndexEntry or null.

createIndexEntry

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

Parameters:
pmIndex - the backend-PersistenceManager used to access the index-datastore.
fieldMeta - the field pointing to the referenced object.
indexedDataEntryID - the DataEntry.dataEntryID of the referenced object.
Returns:
the appropriate IndexEntry; never null.

Cumulus4j API
(1.0.0)

Copyright © 2012 NightLabs Consulting GmbH. All Rights Reserved.