org.apache.labs.bananadb.entity
Class EntityStore

java.lang.Object
  extended by org.apache.labs.bananadb.store.Store
      extended by org.apache.labs.bananadb.entity.EntityStore

public class EntityStore
extends Store

An extention to the core Index that allows for multiple indices in the same store of the type Index The primary indices are unique by their name and the default name is the complete class path and class name of the entity class it contains. Thus: indexA = entityStore.getPrimaryIndex(Long.class, EntityClass.class); indexB = entityStore.getPrimaryIndex(Long.class, EntityClass.class); assertTrue(indexA == indexB); indexA = entityStore.getPrimaryIndex(Long.class, EntityClass.class, "index A"); indexB = entityStore.getPrimaryIndex(Long.class, EntityClass.class, "index B"); assertFalse(indexA == indexB);


Constructor Summary
EntityStore(Configuration configuration)
           
EntityStore(java.io.File dataPath)
           
 
Method Summary
 void close()
           
 Configuration getConfiguration()
           
<PK,V> PrimaryIndex<PK,V>
getPrimaryIndex(java.lang.Class<PK> keyClass, java.lang.Class<V> entityClass)
           
<PK,V> PrimaryIndex<PK,V>
getPrimaryIndex(java.lang.Class<PK> keyClass, java.lang.Class<V> entityClass, java.lang.String indexName)
           
<PK,SK,V> SecondaryIndex<SK,PK,V>
getSecondaryIndex(PrimaryIndex<PK,V> primaryIndex, java.lang.Class<SK> secondaryKeyClass, java.lang.String secondaryKeyAttributeName)
           
 Transaction getTxn()
           
 
Methods inherited from class org.apache.labs.bananadb.store.Store
containsKey, containsKey, createAccessor, get, get, getSequenceManager, keys, open, optimize, put, rehash, remove, setSequenceManager, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityStore

public EntityStore(java.io.File dataPath)
            throws java.io.IOException
Throws:
java.io.IOException

EntityStore

public EntityStore(Configuration configuration)
Method Detail

getConfiguration

public Configuration getConfiguration()
Overrides:
getConfiguration in class Store

getPrimaryIndex

public <PK,V> PrimaryIndex<PK,V> getPrimaryIndex(java.lang.Class<PK> keyClass,
                                                 java.lang.Class<V> entityClass)
                                   throws java.io.IOException
Throws:
java.io.IOException

getPrimaryIndex

public <PK,V> PrimaryIndex<PK,V> getPrimaryIndex(java.lang.Class<PK> keyClass,
                                                 java.lang.Class<V> entityClass,
                                                 java.lang.String indexName)
                                   throws java.io.IOException
Throws:
java.io.IOException

getSecondaryIndex

public <PK,SK,V> SecondaryIndex<SK,PK,V> getSecondaryIndex(PrimaryIndex<PK,V> primaryIndex,
                                                           java.lang.Class<SK> secondaryKeyClass,
                                                           java.lang.String secondaryKeyAttributeName)

getTxn

public Transaction getTxn()
Returns:
A thread local transaction.

close

public void close()
           throws java.io.IOException
Overrides:
close in class Store
Throws:
java.io.IOException


Copyright © 2009 Apache Software Foundation. All Rights Reserved.