Class AbstractArrayStore<E>
java.lang.Object
org.datanucleus.store.rdbms.scostore.BaseContainerStore
org.datanucleus.store.rdbms.scostore.ElementContainerStore
org.datanucleus.store.rdbms.scostore.AbstractArrayStore<E>
- Type Parameters:
E- Type of element in this array
- All Implemented Interfaces:
org.datanucleus.store.types.scostore.ArrayStore<E>, org.datanucleus.store.types.scostore.Store
- Direct Known Subclasses:
FKArrayStore, JoinArrayStore
public abstract class AbstractArrayStore<E>
extends ElementContainerStore
implements org.datanucleus.store.types.scostore.ArrayStore<E>
Abstract representation of the backing store for an array.
-
Field Summary
Fields inherited from class ElementContainerStore
addStmt, clearStmt, containerTable, elementCmd, elementInfo, elementIsPersistentInterface, elementMapping, elementsAreEmbedded, elementsAreSerialised, elementType, iterateUsingDiscriminator, orderMapping, relationDiscriminatorMapping, relationDiscriminatorValue, removeStmt, sizeStmtFields inherited from class BaseContainerStore
allowNulls, clr, dba, ownerMapping, ownerMemberMetaData, relationType, storeMgr -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractArrayStore(RDBMSStoreManager storeMgr, org.datanucleus.ClassLoaderResolver clr) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds one element to the association owner vs elementsvoidclear(org.datanucleus.state.DNStateManager sm) Clear the association from owner to all elements.voidclearInternal(org.datanucleus.state.DNStateManager ownerSM) getArray(org.datanucleus.state.DNStateManager sm) Accessor for the array from the datastore.int[]internalAdd(org.datanucleus.state.DNStateManager sm, E element, org.datanucleus.store.connection.ManagedConnection conn, boolean batched, int orderId, boolean executeNow) Internal method to add a row to the join table.iterator(org.datanucleus.state.DNStateManager ownerSM) Accessor for an iterator through the array elements.booleanMethod to set the array for the specified owner to the passed value.Methods inherited from class ElementContainerStore
getAddStmtForJoinTable, getClearStmt, getComponentInfoForElement, getContainerTable, getElementClassMetaData, getElementMapping, getRelationDiscriminatorMapping, getRelationDiscriminatorValue, getSize, getSizeStmt, hasOrderMapping, invalidateAddStmt, isElementsAreEmbedded, isElementsAreSerialised, size, usingJoinTable, validateElementForReading, validateElementForWriting, validateElementTypeMethods inherited from class BaseContainerStore
allowsBatching, getComponentInformationForClass, getDatastoreAdapter, getOwnerMapping, getOwnerMemberMetaData, getRelationType, getStateManagerForEmbeddedPCObject, getStoreManager, isEmbeddedMapping, setOwnerMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.datanucleus.store.types.scostore.ArrayStore
sizeMethods inherited from interface org.datanucleus.store.types.scostore.Store
getOwnerMemberMetaData, getStoreManager
-
Constructor Details
-
AbstractArrayStore
Constructor.- Parameters:
storeMgr- Manager for the storeclr- ClassLoader resolver
-
-
Method Details
-
getArray
-
clear
public void clear(org.datanucleus.state.DNStateManager sm) Clear the association from owner to all elements. Observes the necessary dependent field settings with respect to whether it should delete the element when doing so.- Specified by:
clearin interfaceorg.datanucleus.store.types.scostore.ArrayStore<E>- Overrides:
clearin classElementContainerStore- Parameters:
sm- StateManager for the container.
-
set
Method to set the array for the specified owner to the passed value.- Specified by:
setin interfaceorg.datanucleus.store.types.scostore.ArrayStore<E>- Parameters:
sm- StateManager for the ownerarray- the array- Returns:
- Whether the array was updated successfully
-
add
Adds one element to the association owner vs elements- Parameters:
sm- StateManager for the containerelement- The element to addposition- The position to add this element at- Returns:
- Whether it was successful
-
iterator
Accessor for an iterator through the array elements.- Specified by:
iteratorin interfaceorg.datanucleus.store.types.scostore.ArrayStore<E>- Specified by:
iteratorin classElementContainerStore- Parameters:
ownerSM- StateManager for the container.- Returns:
- The Iterator
-
clearInternal
public void clearInternal(org.datanucleus.state.DNStateManager ownerSM) -
internalAdd
public int[] internalAdd(org.datanucleus.state.DNStateManager sm, E element, org.datanucleus.store.connection.ManagedConnection conn, boolean batched, int orderId, boolean executeNow) Internal method to add a row to the join table. Used by add() and set() to add a row to the join table.- Parameters:
sm- StateManager for the owner of the collectionelement- The element to add the relation toconn- The connectionbatched- Whether we are batchingorderId- The order id to use for this element relationexecuteNow- Whether to execute the statement now (and not wait for any batch)- Returns:
- Whether a row was inserted
-