org.datanucleus.store.rdbms.scostore
Class RDBMSFKMapStore

java.lang.Object
  extended by org.datanucleus.store.mapped.scostore.BaseContainerStore
      extended by org.datanucleus.store.mapped.scostore.AbstractMapStore
          extended by org.datanucleus.store.mapped.scostore.FKMapStore
              extended by org.datanucleus.store.rdbms.scostore.RDBMSFKMapStore
All Implemented Interfaces:
org.datanucleus.store.mapped.expression.MapStoreQueryable, org.datanucleus.store.scostore.MapStore, org.datanucleus.store.scostore.Store

public class RDBMSFKMapStore
extends org.datanucleus.store.mapped.scostore.FKMapStore

RDBMS-specific implementation of an FKMapStore.


Field Summary
 
Fields inherited from class org.datanucleus.store.mapped.scostore.FKMapStore
clr, keyFieldNumber
 
Fields inherited from class org.datanucleus.store.mapped.scostore.AbstractMapStore
iterateUsingDiscriminator, keyMapping, keysAreEmbedded, keysAreSerialised, keyType, kmd, mapTable, specialization, valueMapping, valuesAreEmbedded, valuesAreSerialised, valueTable, valueType, vmd
 
Fields inherited from class org.datanucleus.store.mapped.scostore.BaseContainerStore
allowsNull, dba, LOCALISER, ownerMapping, ownerMemberMetaData, relationType, storeMgr
 
Constructor Summary
RDBMSFKMapStore(org.datanucleus.metadata.AbstractMemberMetaData mmd, RDBMSManager storeMgr, org.datanucleus.ClassLoaderResolver clr)
          Constructor for the backing store for an FK Map for RDBMS.
 
Method Summary
protected  SQLStatement getSQLStatementForGet(org.datanucleus.StateManager ownerSM)
          Method to return an SQLStatement for retrieving the value for a key.
protected  java.lang.Object getValue(org.datanucleus.StateManager ownerSM, java.lang.Object key)
          Method to retrieve a value from the Map given the key.
protected  void initialise()
           
protected  org.datanucleus.store.mapped.scostore.MapEntrySetStore newMapEntrySetStore()
           
protected  org.datanucleus.store.mapped.scostore.MapKeySetStore newMapKeySetStore()
           
protected  org.datanucleus.store.mapped.scostore.MapValueSetStore newMapValueSetStore()
           
protected  boolean updateKeyFkInternal(org.datanucleus.StateManager sm, java.lang.Object key, java.lang.Object owner)
           
protected  boolean updateValueFkInternal(org.datanucleus.StateManager sm, java.lang.Object value, java.lang.Object owner)
           
 
Methods inherited from class org.datanucleus.store.mapped.scostore.FKMapStore
clear, clearKeyOfValue, entrySetStore, joinKeysTo, joinKeysValuesTo, joinValuesTo, keySetStore, put, remove, validateValueType, valueSetStore
 
Methods inherited from class org.datanucleus.store.mapped.scostore.AbstractMapStore
containsKey, containsValue, get, getExistsSubquery, getKeyMapping, getKeyType, getKmd, getMapTable, getSizeSubquery, getValueMapping, getValueType, getVmd, isValuesAreEmbedded, isValuesAreSerialised, joinKeysToGet, keysAreEmbedded, keysAreSerialised, putAll, updateEmbeddedKey, updateEmbeddedValue, validateKeyForReading, validateKeyForWriting, validateKeyType, validateValueForReading, validateValueForWriting, valuesAreEmbedded, valuesAreSerialised
 
Methods inherited from class org.datanucleus.store.mapped.scostore.BaseContainerStore
allowsBatching, getDatastoreAdapter, getOwnerMapping, getOwnerMemberMetaData, getRelationType, getStateManagerForEmbeddedPCObject, isEmbeddedMapping, setOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RDBMSFKMapStore

public RDBMSFKMapStore(org.datanucleus.metadata.AbstractMemberMetaData mmd,
                       RDBMSManager storeMgr,
                       org.datanucleus.ClassLoaderResolver clr)
Constructor for the backing store for an FK Map for RDBMS.

Parameters:
mmd - Field Meta-Data for the Map field.
storeMgr - The Store Manager we are using.
clr - The ClassLoaderResolver
Method Detail

initialise

protected void initialise()
Specified by:
initialise in class org.datanucleus.store.mapped.scostore.FKMapStore

updateValueFkInternal

protected boolean updateValueFkInternal(org.datanucleus.StateManager sm,
                                        java.lang.Object value,
                                        java.lang.Object owner)
Specified by:
updateValueFkInternal in class org.datanucleus.store.mapped.scostore.FKMapStore

updateKeyFkInternal

protected boolean updateKeyFkInternal(org.datanucleus.StateManager sm,
                                      java.lang.Object key,
                                      java.lang.Object owner)
Specified by:
updateKeyFkInternal in class org.datanucleus.store.mapped.scostore.FKMapStore

getValue

protected java.lang.Object getValue(org.datanucleus.StateManager ownerSM,
                                    java.lang.Object key)
                             throws java.util.NoSuchElementException
Method to retrieve a value from the Map given the key.

Specified by:
getValue in class org.datanucleus.store.mapped.scostore.AbstractMapStore
Parameters:
ownerSM - State Manager for the owner of the map.
key - The key to retrieve the value for.
Returns:
The value for this key
Throws:
java.util.NoSuchElementException - if the key was not found

getSQLStatementForGet

protected SQLStatement getSQLStatementForGet(org.datanucleus.StateManager ownerSM)
Method to return an SQLStatement for retrieving the value for a key. Selects the join table and optionally joins to the value table if it has its own table.

Parameters:
ownerSM - StateManager for the owning object
Returns:
The SQLStatement

newMapKeySetStore

protected org.datanucleus.store.mapped.scostore.MapKeySetStore newMapKeySetStore()
Specified by:
newMapKeySetStore in class org.datanucleus.store.mapped.scostore.FKMapStore

newMapValueSetStore

protected org.datanucleus.store.mapped.scostore.MapValueSetStore newMapValueSetStore()
Specified by:
newMapValueSetStore in class org.datanucleus.store.mapped.scostore.FKMapStore

newMapEntrySetStore

protected org.datanucleus.store.mapped.scostore.MapEntrySetStore newMapEntrySetStore()
Specified by:
newMapEntrySetStore in class org.datanucleus.store.mapped.scostore.FKMapStore


Copyright © 2009. All Rights Reserved.