public class FKMapStore<K,V> extends AbstractMapStore<K,V>
MapStore
where either the value has a FK to the owner (and the key
stored in the value), or whether the key has a FK to the owner (and the value stored in the key).Modifier and Type | Field and Description |
---|---|
protected int |
keyFieldNumber
Field number of key in value class (when Key=Non-PC, Value=PC).
|
iterateUsingDiscriminator, keyMapping, keysAreEmbedded, keysAreSerialised, keyType, kmd, mapTable, valueMapping, valuesAreEmbedded, valuesAreSerialised, valueTable, valueType, vmd
allowNulls, clr, dba, ownerMapping, ownerMemberMetaData, relationType, storeMgr
Constructor and Description |
---|
FKMapStore(org.datanucleus.metadata.AbstractMemberMetaData mmd,
RDBMSStoreManager storeMgr,
org.datanucleus.ClassLoaderResolver clr)
Constructor for the backing store for an FK Map for RDBMS.
|
Modifier and Type | Method and Description |
---|---|
void |
clear(org.datanucleus.state.ObjectProvider op)
Method to clear the map of all values.
|
void |
clearKeyOfValue(org.datanucleus.state.ObjectProvider op,
Object key,
Object oldValue)
Utility to clear the key of a value from the Map.
|
org.datanucleus.store.scostore.SetStore |
entrySetStore()
Accessor for the map entries in the Map.
|
protected SQLStatement |
getSQLStatementForGet(org.datanucleus.state.ObjectProvider ownerOP)
Method to return an SQLStatement for retrieving the value for a key.
|
protected V |
getValue(org.datanucleus.state.ObjectProvider ownerOP,
Object key)
Method to retrieve a value from the Map given the key.
|
protected void |
initialise()
Method to initialise the statements being used.
|
org.datanucleus.store.scostore.SetStore |
keySetStore()
Accessor for the keys in the Map.
|
V |
put(org.datanucleus.state.ObjectProvider op,
K newKey,
V newValue)
Method to put an item in the Map.
|
V |
remove(org.datanucleus.state.ObjectProvider op,
Object key)
Method to remove an entry from the map.
|
V |
remove(org.datanucleus.state.ObjectProvider op,
Object key,
Object oldValue)
Method to remove an entry from the map.
|
protected boolean |
updateKeyFkInternal(org.datanucleus.state.ObjectProvider op,
Object key,
Object owner) |
protected boolean |
updateValueFkInternal(org.datanucleus.state.ObjectProvider op,
Object value,
Object owner) |
protected void |
validateValueType(org.datanucleus.ClassLoaderResolver clr,
Object value)
Utility to validate the type of a value for storing in the Map.
|
org.datanucleus.store.scostore.CollectionStore |
valueCollectionStore()
Accessor for the values in the Map.
|
containsKey, containsValue, get, getKeyMapping, getKmd, getMapTable, getUpdateEmbeddedKeyStmt, getUpdateEmbeddedValueStmt, getValueMapping, getVmd, isValuesAreEmbedded, isValuesAreSerialised, keysAreEmbedded, keysAreSerialised, putAll, updatedEmbeddedKey, updateEmbeddedKey, updateEmbeddedValue, updateEmbeddedValue, validateKeyForReading, validateKeyForWriting, validateKeyType, validateValueForReading, validateValueForWriting, valuesAreEmbedded, valuesAreSerialised
allowsBatching, getDatastoreAdapter, getObjectProviderForEmbeddedPCObject, getOwnerMapping, getOwnerMemberMetaData, getRelationType, getStoreManager, isEmbeddedMapping, setOwner
protected int keyFieldNumber
public FKMapStore(org.datanucleus.metadata.AbstractMemberMetaData mmd, RDBMSStoreManager storeMgr, org.datanucleus.ClassLoaderResolver clr)
mmd
- Field Meta-Data for the Map field.storeMgr
- The Store Manager we are using.clr
- The ClassLoaderResolverprotected void initialise()
AbstractMapStore
initialise
in class AbstractMapStore<K,V>
protected void validateValueType(org.datanucleus.ClassLoaderResolver clr, Object value)
validateValueType
in class AbstractMapStore<K,V>
value
- The value to check.clr
- The ClassLoaderResolverpublic V put(org.datanucleus.state.ObjectProvider op, K newKey, V newValue)
op
- ObjectProvider for the map.newKey
- The key to store the value againstnewValue
- The value to store.public V remove(org.datanucleus.state.ObjectProvider op, Object key)
op
- ObjectProvider for the map.key
- Key of the entry to remove.public V remove(org.datanucleus.state.ObjectProvider op, Object key, Object oldValue)
op
- ObjectProvider for the map.key
- Key of the entry to remove.public void clear(org.datanucleus.state.ObjectProvider op)
op
- ObjectProvider for the map.public void clearKeyOfValue(org.datanucleus.state.ObjectProvider op, Object key, Object oldValue)
op
- ObjectProvider for the map.key
- Key of the objectoldValue
- Value to removepublic org.datanucleus.store.scostore.SetStore keySetStore()
public org.datanucleus.store.scostore.CollectionStore valueCollectionStore()
public org.datanucleus.store.scostore.SetStore entrySetStore()
protected boolean updateValueFkInternal(org.datanucleus.state.ObjectProvider op, Object value, Object owner)
protected boolean updateKeyFkInternal(org.datanucleus.state.ObjectProvider op, Object key, Object owner)
protected V getValue(org.datanucleus.state.ObjectProvider ownerOP, Object key) throws NoSuchElementException
getValue
in class AbstractMapStore<K,V>
ownerOP
- ObjectProvider for the owner of the map.key
- The key to retrieve the value for.NoSuchElementException
- if the key was not foundprotected SQLStatement getSQLStatementForGet(org.datanucleus.state.ObjectProvider ownerOP)
ownerOP
- ObjectProvider for the owning objectCopyright © 2017. All rights reserved.