Cumulus4j API
(1.0.1)

org.cumulus4j.store.model
Class IndexEntryFactoryRegistry

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

public class IndexEntryFactoryRegistry
extends Object

Registry responsible for the extension-point org.cumulus4j.store.index_mapping.

This registry maps an IndexEntryFactory to a java-type or a combination of java-, jdbc- and sql-type.

There is one instance of IndexEntryFactoryRegistry per Cumulus4jStoreManager.

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

Constructor Summary
IndexEntryFactoryRegistry(Cumulus4jStoreManager storeMgr)
          Create a new registry instance.
 
Method Summary
 IndexEntryFactory getIndexEntryFactory(ExecutionContext executionContext, FieldMeta fieldMeta, boolean throwExceptionIfNotFound)
          Get the appropriate IndexEntryFactory subclass instance for the given FieldMeta.
 IndexEntryFactory getIndexEntryFactoryForContainerSize()
          Get the special IndexEntryFactory used for container-sizes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexEntryFactoryRegistry

public IndexEntryFactoryRegistry(Cumulus4jStoreManager storeMgr)
Create a new registry instance.

Parameters:
storeMgr - the owning store-manager.
Method Detail

getIndexEntryFactory

public IndexEntryFactory getIndexEntryFactory(ExecutionContext executionContext,
                                              FieldMeta fieldMeta,
                                              boolean throwExceptionIfNotFound)
Get the appropriate IndexEntryFactory subclass instance for the given FieldMeta.

Parameters:
executionContext - the context.
fieldMeta - either a FieldMeta for a primary field or a sub-FieldMeta, if a Collection element, a Map key, a Map value or similar are indexed.
throwExceptionIfNotFound - throw an exception instead of returning null, if there is no IndexEntryFactory for the given fieldMeta.
Returns:
the appropriate IndexEntryFactory or null, if none is registered and throwExceptionIfNotFound == false.

getIndexEntryFactoryForContainerSize

public IndexEntryFactory getIndexEntryFactoryForContainerSize()
Get the special IndexEntryFactory used for container-sizes. This special index allows using Collection.isEmpty(), Collection.size() and the like in JDOQL (or "SIZE(...)" and the like in JPQL).

Returns:
the special IndexEntryFactory used for container-sizes.

Cumulus4j API
(1.0.1)

Copyright © 2012 NightLabs Consulting GmbH. All Rights Reserved.