org.datanucleus.store.mapped.scostore
Class MapValueSetStore
java.lang.Object
org.datanucleus.store.mapped.scostore.BaseContainerStore
org.datanucleus.store.mapped.scostore.ElementContainerStore
org.datanucleus.store.mapped.scostore.AbstractCollectionStore
org.datanucleus.store.mapped.scostore.AbstractSetStore
org.datanucleus.store.mapped.scostore.MapValueSetStore
- All Implemented Interfaces:
- CollectionStore, SetStore, Store
public abstract class MapValueSetStore
- extends AbstractSetStore
Representation of the backing store for the values of a Map.
This is used where the user calls Map.values() and then wants to perform some operation on the resulting
Collection. The values for a Map can be stored in several ways. There are the following possibilities
- Map using join table - join table contains the key and value (or FK's to their tables)
- Map using key table - Key table stores the value (or an FK to its table)
- Map using value table - Value table stores the key (or an FK to its table)
| Fields inherited from class org.datanucleus.store.mapped.scostore.ElementContainerStore |
clr, containerTable, elementInfo, elementIsPersistentInterface, elementMapping, elementsAreEmbedded, elementsAreSerialised, elementType, emd, iterateUsingDiscriminator, orderMapping, relationDiscriminatorMapping, relationDiscriminatorValue, specialization |
|
Constructor Summary |
MapValueSetStore(DatastoreClass mapTable,
AbstractMemberMetaData ownerMmd,
JavaTypeMapping ownerMapping,
JavaTypeMapping valueMapping,
MapStore mapStore,
ClassLoaderResolver clr,
AbstractSetStoreSpecialization specialization)
Constructor where either the key is stored in the value table or the value is stored in the key table. |
MapValueSetStore(DatastoreContainerObject mapTable,
AbstractMemberMetaData ownerMmd,
JavaTypeMapping ownerMapping,
JavaTypeMapping keyMapping,
JavaTypeMapping valueMapping,
MapStore mapStore,
ClassLoaderResolver clr,
AbstractSetStoreSpecialization specialization)
Constructor where a join table is used to store the map relation. |
|
Method Summary |
boolean |
add(ObjectProvider sm,
java.lang.Object element,
int size)
Method to add a value to the Map. |
boolean |
addAll(ObjectProvider sm,
java.util.Collection elements,
int size)
Method to add entries to the Map. |
protected abstract boolean |
canClear()
|
void |
clear(ObjectProvider sm)
Method to clear the map. |
protected abstract boolean |
remove(ObjectProvider sm,
java.lang.Object element)
|
boolean |
remove(ObjectProvider sm,
java.lang.Object element,
int size,
boolean allowDependentField)
Method to remove a value from the Map. |
boolean |
removeAll(ObjectProvider sm,
java.util.Collection elements,
int size)
Method to remove values from the map via the value collection. |
| Methods inherited from class org.datanucleus.store.mapped.scostore.ElementContainerStore |
getContainerTable, getElementInfo, getElementInformationForClass, getElementMapping, getElementType, getEmd, getOrderMapping, getRelationDiscriminatorMapping, getRelationDiscriminatorValue, hasOrderMapping, isElementsAreEmbedded, isElementsAreSerialised, size, validateElementForReading, validateElementForWriting, validateElementType |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mapStore
protected final MapStore mapStore
keyMapping
protected final JavaTypeMapping keyMapping
MapValueSetStore
public MapValueSetStore(DatastoreContainerObject mapTable,
AbstractMemberMetaData ownerMmd,
JavaTypeMapping ownerMapping,
JavaTypeMapping keyMapping,
JavaTypeMapping valueMapping,
MapStore mapStore,
ClassLoaderResolver clr,
AbstractSetStoreSpecialization specialization)
- Constructor where a join table is used to store the map relation.
- Parameters:
mapTable - Table used by the mapownerMmd - Metadata for the owning field/propertyownerMapping - the owner mappingkeyMapping - the key mappingvalueMapping - the value mappingmapStore - Store used by the mapclr - The ClassLoaderResolverspecialization - the specialisation
MapValueSetStore
public MapValueSetStore(DatastoreClass mapTable,
AbstractMemberMetaData ownerMmd,
JavaTypeMapping ownerMapping,
JavaTypeMapping valueMapping,
MapStore mapStore,
ClassLoaderResolver clr,
AbstractSetStoreSpecialization specialization)
- Constructor where either the key is stored in the value table or the value is stored in the key table.
- Parameters:
mapTable - Table storing the map relation (key or value table)ownerMmd - FieldMetaData for the owning "map" fieldownerMapping - Mapping to the owner from this tablevalueMapping - Mapping for this table to the valuemapStore - Store used by the map.clr - The ClassLoaderResolverspecialization - the specialization
add
public boolean add(ObjectProvider sm,
java.lang.Object element,
int size)
- Method to add a value to the Map. Not supported.
- Specified by:
add in interface CollectionStore- Overrides:
add in class AbstractSetStore
- Parameters:
sm - State Manager for the ownerelement - The value to addsize - Current size of the collection if known. -1 if not known
- Returns:
- Whether it was added correctly.
addAll
public boolean addAll(ObjectProvider sm,
java.util.Collection elements,
int size)
- Method to add entries to the Map. Not supported.
- Specified by:
addAll in interface CollectionStore- Overrides:
addAll in class AbstractSetStore
- Parameters:
sm - State Manager for the ownerelements - The values to addsize - Current size of set (if known). Not used by sets
- Returns:
- Whether it was added correctly.
remove
public boolean remove(ObjectProvider sm,
java.lang.Object element,
int size,
boolean allowDependentField)
- Method to remove a value from the Map.
- Specified by:
remove in interface CollectionStore- Overrides:
remove in class AbstractSetStore
- Parameters:
sm - State Manager for the ownerelement - The value to removesize - Current sizeallowDependentField - Whether to allow any cascade deletes caused by this removal
- Returns:
- Whether it was removed correctly.
removeAll
public boolean removeAll(ObjectProvider sm,
java.util.Collection elements,
int size)
- Method to remove values from the map via the value collection.
- Specified by:
removeAll in interface CollectionStore- Overrides:
removeAll in class AbstractSetStore
- Parameters:
sm - StateManager for the ownerelements - Collection of elements to removesize - Current size of collection if known. -1 if not known
- Returns:
- Whether the database was updated
clear
public void clear(ObjectProvider sm)
- Method to clear the map.
- Specified by:
clear in interface CollectionStore- Overrides:
clear in class ElementContainerStore
- Parameters:
sm - StateManager for the owner
canClear
protected abstract boolean canClear()
remove
protected abstract boolean remove(ObjectProvider sm,
java.lang.Object element)
Copyright © 2011. All Rights Reserved.