public class JoinMapStore extends AbstractMapStore
MapStore
using join table.Modifier and Type | Field and Description |
---|---|
protected JavaTypeMapping |
adapterMapping
when the element mappings columns can't be part of the primary key
by datastore limitations like BLOB types.
|
iterateUsingDiscriminator, keyMapping, keysAreEmbedded, keysAreSerialised, keyType, kmd, mapTable, valueMapping, valuesAreEmbedded, valuesAreSerialised, valueTable, valueType, vmd
allowNulls, clr, dba, ownerMapping, ownerMemberMetaData, relationType, storeMgr
Constructor and Description |
---|
JoinMapStore(MapTable mapTable,
org.datanucleus.ClassLoaderResolver clr)
Constructor for the backing store of a join map for RDBMS.
|
Modifier and Type | Method and Description |
---|---|
void |
clear(org.datanucleus.state.ObjectProvider ownerOP)
Method to clear the map of all values.
|
protected void |
clearInternal(org.datanucleus.state.ObjectProvider ownerOP) |
org.datanucleus.store.scostore.SetStore |
entrySetStore()
Accessor for the map entries in the Map.
|
JavaTypeMapping |
getAdapterMapping() |
protected SQLStatement |
getSQLStatementForGet(org.datanucleus.state.ObjectProvider ownerOP)
Method to return an SQLStatement for retrieving the value for a key.
|
protected Object |
getValue(org.datanucleus.state.ObjectProvider ownerOP,
Object key)
Method to retrieve a value from the Map given the key.
|
protected int[] |
internalPut(org.datanucleus.state.ObjectProvider ownerOP,
org.datanucleus.store.connection.ManagedConnection conn,
boolean batched,
Object key,
Object value,
boolean executeNow)
Method to process a "put" statement (where the key has no value in the join table).
|
protected void |
internalUpdate(org.datanucleus.state.ObjectProvider ownerOP,
org.datanucleus.store.connection.ManagedConnection conn,
boolean batched,
Object key,
Object value,
boolean executeNow)
Method to process an "update" statement (where the key already has a value in the join table).
|
org.datanucleus.store.scostore.SetStore |
keySetStore()
Accessor for the keys in the Map.
|
protected org.datanucleus.store.scostore.SetStore |
newMapEntrySetStore() |
protected org.datanucleus.store.scostore.SetStore |
newMapKeySetStore() |
protected org.datanucleus.store.scostore.CollectionStore |
newMapValueCollectionStore() |
Object |
put(org.datanucleus.state.ObjectProvider op,
Object key,
Object value)
Method to put an item in the Map.
|
void |
putAll(org.datanucleus.state.ObjectProvider op,
Map m)
Method to put all elements from a Map into our Map.
|
Object |
remove(org.datanucleus.state.ObjectProvider op,
Object key)
Method to remove an entry from the map.
|
Object |
remove(org.datanucleus.state.ObjectProvider op,
Object key,
Object oldValue)
Method to remove an item from the map.
|
protected void |
removeInternal(org.datanucleus.state.ObjectProvider op,
Object key) |
org.datanucleus.store.scostore.CollectionStore |
valueCollectionStore()
Accessor for the values in the Map.
|
containsKey, containsValue, get, getKeyMapping, getKmd, getMapTable, getUpdateEmbeddedKeyStmt, getUpdateEmbeddedValueStmt, getValueMapping, getVmd, initialise, isValuesAreEmbedded, isValuesAreSerialised, keysAreEmbedded, keysAreSerialised, updatedEmbeddedKey, updateEmbeddedKey, updateEmbeddedValue, updateEmbeddedValue, validateKeyForReading, validateKeyForWriting, validateKeyType, validateValueForReading, validateValueForWriting, validateValueType, valuesAreEmbedded, valuesAreSerialised
allowsBatching, getDatastoreAdapter, getObjectProviderForEmbeddedPCObject, getOwnerMapping, getOwnerMemberMetaData, getRelationType, getStoreManager, isEmbeddedMapping, setOwner
protected final JavaTypeMapping adapterMapping
public JoinMapStore(MapTable mapTable, org.datanucleus.ClassLoaderResolver clr)
mapTable
- Join table for the Mapclr
- The ClassLoaderResolverpublic void putAll(org.datanucleus.state.ObjectProvider op, Map m)
putAll
in interface org.datanucleus.store.scostore.MapStore
putAll
in class AbstractMapStore
op
- ObjectProvider for the Mapm
- The Map to addpublic Object put(org.datanucleus.state.ObjectProvider op, Object key, Object value)
op
- ObjectProvider for the map.key
- The key to store the value againstvalue
- The value to store.public Object remove(org.datanucleus.state.ObjectProvider op, Object key)
op
- ObjectProvider for the map.key
- Key of the entry to remove.public Object remove(org.datanucleus.state.ObjectProvider op, Object key, Object oldValue)
op
- ObjectProvider for the map.key
- Key of the item to remove.public void clear(org.datanucleus.state.ObjectProvider ownerOP)
ownerOP
- ObjectProvider for the map.public org.datanucleus.store.scostore.SetStore keySetStore()
public org.datanucleus.store.scostore.CollectionStore valueCollectionStore()
public org.datanucleus.store.scostore.SetStore entrySetStore()
public JavaTypeMapping getAdapterMapping()
protected Object getValue(org.datanucleus.state.ObjectProvider ownerOP, Object key) throws NoSuchElementException
getValue
in class AbstractMapStore
ownerOP
- ObjectProvider for the owner of the map.key
- The key to retrieve the value for.NoSuchElementException
- if the value for the key was not foundprotected SQLStatement getSQLStatementForGet(org.datanucleus.state.ObjectProvider ownerOP)
ownerOP
- ObjectProvider for the owning objectprotected void clearInternal(org.datanucleus.state.ObjectProvider ownerOP)
protected void removeInternal(org.datanucleus.state.ObjectProvider op, Object key)
protected org.datanucleus.store.scostore.SetStore newMapKeySetStore()
protected org.datanucleus.store.scostore.CollectionStore newMapValueCollectionStore()
protected org.datanucleus.store.scostore.SetStore newMapEntrySetStore()
protected void internalUpdate(org.datanucleus.state.ObjectProvider ownerOP, org.datanucleus.store.connection.ManagedConnection conn, boolean batched, Object key, Object value, boolean executeNow) throws MappedDatastoreException
ownerOP
- ObjectProvider for the ownerconn
- The Connectionbatched
- Whether we are batching itkey
- The keyvalue
- The new valueexecuteNow
- Whether to execute the statement now or wait til any batchMappedDatastoreException
- Thrown if an error occursprotected int[] internalPut(org.datanucleus.state.ObjectProvider ownerOP, org.datanucleus.store.connection.ManagedConnection conn, boolean batched, Object key, Object value, boolean executeNow) throws MappedDatastoreException
ownerOP
- ObjectProvider for the ownerconn
- The Connectionbatched
- Whether we are batching itkey
- The keyvalue
- The valueexecuteNow
- Whether to execute the statement now or wait til batchingMappedDatastoreException
- Thrown if an error occursCopyright © 2015. All rights reserved.