Class FKArrayStore<E>
- java.lang.Object
-
- org.datanucleus.store.rdbms.scostore.BaseContainerStore
-
- org.datanucleus.store.rdbms.scostore.ElementContainerStore
-
- org.datanucleus.store.rdbms.scostore.AbstractArrayStore<E>
-
- org.datanucleus.store.rdbms.scostore.FKArrayStore<E>
-
- All Implemented Interfaces:
org.datanucleus.store.types.scostore.ArrayStore<E>,org.datanucleus.store.types.scostore.Store
public class FKArrayStore<E> extends AbstractArrayStore<E>
RDBMS-specific implementation of an FK ArrayStore.
-
-
Field Summary
-
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 Constructor Description FKArrayStore(org.datanucleus.metadata.AbstractMemberMetaData mmd, RDBMSStoreManager storeMgr, org.datanucleus.ClassLoaderResolver clr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear(org.datanucleus.state.ObjectProvider ownerOP)Method to clear the Array.protected StringgetClearNullifyStmt()Generates the statement for clearing items by nulling the owner link out.ElementIteratorStatementgetIteratorStatement(org.datanucleus.ExecutionContext ec, org.datanucleus.FetchPlan fp, boolean addRestrictionOnOwner)Method to return the SQLStatement and mapping for an iterator for this backing store.Iterator<E>iterator(org.datanucleus.state.ObjectProvider ownerOP)Accessor for an iterator for the set.booleanset(org.datanucleus.state.ObjectProvider ownerOP, Object array)Method to set the array for the specified owner to the passed value.-
Methods inherited from class org.datanucleus.store.rdbms.scostore.AbstractArrayStore
add, clearInternal, getArray, internalAdd, processBatchedWrites
-
Methods inherited from class org.datanucleus.store.rdbms.scostore.ElementContainerStore
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
-
-
-
-
Constructor Detail
-
FKArrayStore
public FKArrayStore(org.datanucleus.metadata.AbstractMemberMetaData mmd, RDBMSStoreManager storeMgr, org.datanucleus.ClassLoaderResolver clr)- Parameters:
mmd- Metadata for the owning field/propertystoreMgr- Manager for the datastoreclr- ClassLoader resolver
-
-
Method Detail
-
clear
public void clear(org.datanucleus.state.ObjectProvider ownerOP)
Method to clear the Array. This is called when the container object is being deleted and the elements are to be removed (maybe for dependent field).- Specified by:
clearin interfaceorg.datanucleus.store.types.scostore.ArrayStore<E>- Overrides:
clearin classAbstractArrayStore<E>- Parameters:
ownerOP- The ObjectProvider
-
getClearNullifyStmt
protected String getClearNullifyStmt()
Generates the statement for clearing items by nulling the owner link out. The statement will beUPDATE ARRAYTABLE SET OWNERCOL=NULL, INDEXCOL=NULL [,DISTINGUISHER=NULL] WHERE OWNERCOL=? [AND DISTINGUISHER=?]
when there is only one element table, and will beUPDATE ? SET OWNERCOL=NULL, INDEXCOL=NULL [,DISTINGUISHER=NULL] WHERE OWNERCOL=? [AND DISTINGUISHER=?]
when there is more than 1 element table.- Returns:
- The Statement for clearing items for the owner.
-
set
public boolean set(org.datanucleus.state.ObjectProvider ownerOP, Object array)Method to set the array for the specified owner to the passed value.- Specified by:
setin interfaceorg.datanucleus.store.types.scostore.ArrayStore<E>- Overrides:
setin classAbstractArrayStore<E>- Parameters:
ownerOP- ObjectProvider for the ownerarray- the array- Returns:
- Whether the array was updated successfully
-
iterator
public Iterator<E> iterator(org.datanucleus.state.ObjectProvider ownerOP)
Accessor for an iterator for the set.- Specified by:
iteratorin interfaceorg.datanucleus.store.types.scostore.ArrayStore<E>- Specified by:
iteratorin classAbstractArrayStore<E>- Parameters:
ownerOP- ObjectProvider for the set.- Returns:
- Iterator for the set.
-
getIteratorStatement
public ElementIteratorStatement getIteratorStatement(org.datanucleus.ExecutionContext ec, org.datanucleus.FetchPlan fp, boolean addRestrictionOnOwner)
Method to return the SQLStatement and mapping for an iterator for this backing store. Create a statement of the formSELECT ELEM_COLS FROM ELEM_TBL [WHERE] [ELEM_TBL.OWNER_ID = {value}] [AND] [ELEM_TBL.DISCRIM = {discrimValue}] [ORDER BY {orderClause}]- Parameters:
ec- ExecutionContextfp- FetchPlan to use in determing which fields of element to selectaddRestrictionOnOwner- Whether to restrict to a particular owner (otherwise functions as bulk fetch for many owners).- Returns:
- The SQLStatement and its associated StatementClassMapping
-
-