org.datanucleus.store.mapped.scostore
Class MapKeySetStore
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.MapKeySetStore
- All Implemented Interfaces:
- CollectionStore, SetStore, Store
public abstract class MapKeySetStore
- extends AbstractSetStore
Representation of the backing store for the keys of a Map.
This is used where the user calls Map.keySet() and then wants to perform some operation on the resulting Set.
The keys 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 |
|
Method Summary |
boolean |
add(ObjectProvider sm,
java.lang.Object element,
int size)
Method to add an element. |
boolean |
addAll(ObjectProvider sm,
java.util.Collection elements,
int size)
Method to add a collection of elements. |
protected abstract boolean |
canClear()
|
protected abstract boolean |
canRemove()
|
void |
clear(ObjectProvider sm)
Method to clear the collection. |
boolean |
remove(ObjectProvider sm,
java.lang.Object element,
int size,
boolean allowDependentField)
Method to remove an element. |
boolean |
removeAll(ObjectProvider sm,
java.util.Collection elements,
int size)
Method to remove a collection of elements. |
| 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
MapKeySetStore
public MapKeySetStore(DatastoreContainerObject mapTable,
AbstractMemberMetaData ownerMmd,
JavaTypeMapping ownerMapping,
JavaTypeMapping keyMapping,
MapStore mapStore,
ClassLoaderResolver clr,
AbstractSetStoreSpecialization specialization)
- Constructor for a backing store for the keys of a map relation.
- Parameters:
mapTable - The table for the map (table storing the map linkage)ownerMmd - Metadata for the owner memberownerMapping - mapping from the map table to the owner tablekeyMapping - mapping from the map table to the keymapStore - The backing store for the mapclr - The ClassLoaderResolverspecialization - The specialisation
add
public boolean add(ObjectProvider sm,
java.lang.Object element,
int size)
- Method to add an element. Overridden because we want to prevent it.
- Specified by:
add in interface CollectionStore- Overrides:
add in class AbstractSetStore
- Parameters:
sm - State Manager of collection.element - Element to add.size - Current size of the collection if known. -1 if not known
- Returns:
- Whether it was successful
addAll
public boolean addAll(ObjectProvider sm,
java.util.Collection elements,
int size)
- Method to add a collection of elements. Overridden because we want to prevent it.
- Specified by:
addAll in interface CollectionStore- Overrides:
addAll in class AbstractSetStore
- Parameters:
sm - State Manager of collection.elements - Elements to add.size - Current size of set (if known). Not used by sets
- Returns:
- Whether it was successful
remove
public boolean remove(ObjectProvider sm,
java.lang.Object element,
int size,
boolean allowDependentField)
- Method to remove an element. Overridden because we want to prevent it.
- Specified by:
remove in interface CollectionStore- Overrides:
remove in class AbstractSetStore
- Parameters:
sm - State Manager of collection.element - Element to remove.size - Current sizeallowDependentField - Whether to allow any cascade deletes caused by this removal
- Returns:
- Whether it was successful
removeAll
public boolean removeAll(ObjectProvider sm,
java.util.Collection elements,
int size)
- Method to remove a collection of elements. Overridden because we want to prevent it.
- Specified by:
removeAll in interface CollectionStore- Overrides:
removeAll in class AbstractSetStore
- Parameters:
sm - State Manager of collection.elements - Elements to remove.size - Current size of collection if known. -1 if not known
- Returns:
- Whether it was successful
clear
public void clear(ObjectProvider sm)
- Method to clear the collection. Overridden because we want to prevent it.
- Specified by:
clear in interface CollectionStore- Overrides:
clear in class ElementContainerStore
- Parameters:
sm - State Manager of collection.
canRemove
protected abstract boolean canRemove()
canClear
protected abstract boolean canClear()
Copyright © 2011. All Rights Reserved.