org.datanucleus.store.mapped.scostore
Class AbstractSetStore
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
- All Implemented Interfaces:
- CollectionStore, SetStore, Store
- Direct Known Subclasses:
- FKSetStore, JoinSetStore, MapKeySetStore, MapValueSetStore
public abstract class AbstractSetStore
- extends AbstractCollectionStore
- implements SetStore
Abstract representation of the backing store for a Set/Collection.
| 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)
Adds one element to the association owner vs elements |
boolean |
addAll(ObjectProvider sm,
java.util.Collection elements,
int size)
Adds all elements from a collection to the association owner vs elements |
abstract java.util.Iterator |
iterator(ObjectProvider ownerSM)
Accessor for an iterator for the set. |
boolean |
remove(ObjectProvider sm,
java.lang.Object element,
int size,
boolean allowDependentField)
Removes the association to one element |
boolean |
removeAll(ObjectProvider sm,
java.util.Collection elements,
int size)
Remove all elements from a collection from the association owner vs
elements. |
| Methods inherited from class org.datanucleus.store.mapped.scostore.ElementContainerStore |
clear, 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 |
AbstractSetStore
protected AbstractSetStore(StoreManager storeMgr,
ClassLoaderResolver clr,
AbstractSetStoreSpecialization specialization)
- Constructor.
- Parameters:
storeMgr - Manager for the storeclr - The ClassLoaderResolverspecialization - the datastore-specific specialization
iterator
public abstract java.util.Iterator iterator(ObjectProvider ownerSM)
- Accessor for an iterator for the set.
Implemented by the subclass using whatever mechanism the underlying datastore provides.
- Specified by:
iterator in interface CollectionStore- Specified by:
iterator in class ElementContainerStore
- Parameters:
ownerSM - State Manager for the set.
- Returns:
- Iterator for the set.
add
public boolean add(ObjectProvider sm,
java.lang.Object element,
int size)
- Adds one element to the association owner vs elements
- Specified by:
add in interface CollectionStore
- Parameters:
sm - State Manager for the containerelement - The element to addsize - 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)
- Adds all elements from a collection to the association owner vs elements
- Specified by:
addAll in interface CollectionStore
- Parameters:
sm - State Manager for the containerelements - The elements to addsize - 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)
- Removes the association to one element
- Specified by:
remove in interface CollectionStore
- Parameters:
sm - State Manager for the containerelement - Element to removesize - 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)
- Remove all elements from a collection from the association owner vs
elements. This implementation iterates around the remove() method doing
each element 1 at a time. Please refer to the JoinSetStore and
FKSetStore for the variations used there. This is used for Map key and value
stores.
- Specified by:
removeAll in interface CollectionStore
- Parameters:
sm - State Manager for the containerelements - Collection of elements to removesize - Current size of collection if known. -1 if not known
- Returns:
- Whether the database was updated
Copyright © 2011. All Rights Reserved.