Class AbstractSetStore<E>
- java.lang.Object
-
- org.datanucleus.store.rdbms.scostore.BaseContainerStore
-
- org.datanucleus.store.rdbms.scostore.ElementContainerStore
-
- org.datanucleus.store.rdbms.scostore.AbstractCollectionStore<E>
-
- org.datanucleus.store.rdbms.scostore.AbstractSetStore<E>
-
- All Implemented Interfaces:
org.datanucleus.store.types.scostore.CollectionStore<E>,org.datanucleus.store.types.scostore.SetStore<E>,org.datanucleus.store.types.scostore.Store
- Direct Known Subclasses:
FKSetStore,JoinSetStore
public abstract class AbstractSetStore<E> extends AbstractCollectionStore<E> implements org.datanucleus.store.types.scostore.SetStore<E>
Abstract representation of the backing store for a Set/Collection. Can be used for a join table set, or a map key set.
-
-
Field Summary
-
Fields inherited from class org.datanucleus.store.rdbms.scostore.AbstractCollectionStore
containsStmt
-
Fields inherited from class org.datanucleus.store.rdbms.scostore.ElementContainerStore
addStmt, clearStmt, containerTable, elementCmd, elementInfo, elementIsPersistentInterface, elementMapping, elementsAreEmbedded, elementsAreSerialised, elementType, iterateUsingDiscriminator, orderMapping, relationDiscriminatorMapping, relationDiscriminatorValue, removeStmt, sizeStmt
-
Fields inherited from class org.datanucleus.store.rdbms.scostore.BaseContainerStore
allowNulls, clr, dba, ownerMapping, ownerMemberMetaData, relationType, storeMgr
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSetStore(RDBMSStoreManager storeMgr, org.datanucleus.ClassLoaderResolver clr)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Iterator<E>iterator(org.datanucleus.state.ObjectProvider op)Accessor for an iterator for the set.booleanremove(org.datanucleus.state.ObjectProvider op, Object element, int size, boolean allowDependentField)Removes the association to one elementbooleanremoveAll(org.datanucleus.state.ObjectProvider op, Collection elements, int size)Remove all elements from a collection from the association owner vs elements.-
Methods inherited from class org.datanucleus.store.rdbms.scostore.AbstractCollectionStore
contains, getRemoveStmt, getUpdateEmbeddedElementStmt, update, updateEmbeddedElement, updateEmbeddedElement
-
Methods inherited from class org.datanucleus.store.rdbms.scostore.ElementContainerStore
clear, getAddStmtForJoinTable, getClearStmt, getComponentInfoForElement, getContainerTable, getElementClassMetaData, getElementMapping, getRelationDiscriminatorMapping, getRelationDiscriminatorValue, getSize, getSizeStmt, hasOrderMapping, invalidateAddStmt, isElementsAreEmbedded, isElementsAreSerialised, size, usingJoinTable, validateElementForReading, validateElementForWriting, validateElementType
-
Methods inherited from class org.datanucleus.store.rdbms.scostore.BaseContainerStore
allowsBatching, getComponentInformationForClass, getDatastoreAdapter, getObjectProviderForEmbeddedPCObject, getOwnerMapping, getOwnerMemberMetaData, getRelationType, getStoreManager, isEmbeddedMapping, setOwner
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
AbstractSetStore
protected AbstractSetStore(RDBMSStoreManager storeMgr, org.datanucleus.ClassLoaderResolver clr)
Constructor.- Parameters:
storeMgr- Manager for the storeclr- The ClassLoaderResolver
-
-
Method Detail
-
iterator
public abstract Iterator<E> iterator(org.datanucleus.state.ObjectProvider op)
Accessor for an iterator for the set. Implemented by the subclass using whatever mechanism the underlying datastore provides.- Specified by:
iteratorin interfaceorg.datanucleus.store.types.scostore.CollectionStore<E>- Specified by:
iteratorin classElementContainerStore- Parameters:
op- ObjectProvider for the set.- Returns:
- Iterator for the set.
-
remove
public boolean remove(org.datanucleus.state.ObjectProvider op, Object element, int size, boolean allowDependentField)Removes the association to one element- Specified by:
removein interfaceorg.datanucleus.store.types.scostore.CollectionStore<E>- Parameters:
op- ObjectProvider 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(org.datanucleus.state.ObjectProvider op, 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:
removeAllin interfaceorg.datanucleus.store.types.scostore.CollectionStore<E>- Parameters:
op- ObjectProvider for the containerelements- Collection of elements to remove- Returns:
- Whether the database was updated
-
-