public class FKSetStore extends AbstractSetStore
SetStore
using foreign keys.ElementContainerStore.ElementInfo
containsStmt
addStmt, clearStmt, containerTable, elementInfo, elementIsPersistentInterface, elementMapping, elementsAreEmbedded, elementsAreSerialised, elementType, emd, iterateUsingDiscriminator, orderMapping, relationDiscriminatorMapping, relationDiscriminatorValue, removeStmt, sizeStmt, usingDiscriminatorInSizeStmt
allowNulls, clr, dba, ownerMapping, ownerMemberMetaData, relationType, storeMgr
Constructor and Description |
---|
FKSetStore(org.datanucleus.metadata.AbstractMemberMetaData mmd,
RDBMSStoreManager storeMgr,
org.datanucleus.ClassLoaderResolver clr)
Constructor for the backing store of a FK set for RDBMS.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(org.datanucleus.state.ObjectProvider op,
Object element,
int size)
Method to add an object to the relationship at the collection end.
|
boolean |
addAll(org.datanucleus.state.ObjectProvider op,
Collection elements,
int size)
Method to add a collection of object to the relationship at the collection end.
|
protected boolean |
checkRemovalOfElementShouldDelete(org.datanucleus.state.ObjectProvider op)
Convenience method to return if the removal of an element should delete the element.
|
void |
clear(org.datanucleus.state.ObjectProvider op)
Method to allow the Set relationship to be cleared out.
|
protected String |
getClearNullifyStmt()
Generates the statement for clearing items by nulling the owner link out.
|
protected int |
getFieldNumberInElementForBidirectional(org.datanucleus.state.ObjectProvider op)
This seems to return the field number in the element of the relation when it is a bidirectional relation.
|
IteratorStatement |
getIteratorStatement(org.datanucleus.ClassLoaderResolver clr,
org.datanucleus.FetchPlan fp,
boolean addRestrictionOnOwner)
Method to return the SQLStatement and mapping for an iterator for this backing store.
|
Iterator |
iterator(org.datanucleus.state.ObjectProvider op)
Accessor for an iterator for the set.
|
protected void |
manageRemovalOfElement(org.datanucleus.state.ObjectProvider op,
Object element)
Convenience method to manage the removal of an element from the collection, performing
any necessary "managed relationship" updates when the field is bidirectional.
|
boolean |
remove(org.datanucleus.state.ObjectProvider op,
Object element,
int size,
boolean allowDependentField)
Method to remove the link to the collection object specified.
|
boolean |
removeAll(org.datanucleus.state.ObjectProvider op,
Collection elements,
int size)
Method to remove the links to a collection of elements specified.
|
void |
update(org.datanucleus.state.ObjectProvider op,
Collection coll)
Method to update the collection to be the supplied collection of elements.
|
contains, containsInternal, getRemoveStmt, getUpdateEmbeddedElementStmt, updateEmbeddedElement, updateEmbeddedElement
executeClear, getAddStmtForJoinTable, getClearStmt, getContainerTable, getElementInfo, getElementInformationForClass, getElementMapping, getEmd, getOrderMapping, getRelationDiscriminatorMapping, getRelationDiscriminatorValue, getSize, getSizeStmt, hasOrderMapping, invalidateAddStmt, isElementsAreEmbedded, isElementsAreSerialised, size, validateElementForReading, validateElementForWriting, validateElementType
allowsBatching, getDatastoreAdapter, getObjectProviderForEmbeddedPCObject, getOwnerMapping, getOwnerMemberMetaData, getRelationType, getStoreManager, isEmbeddedMapping, setOwner
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public FKSetStore(org.datanucleus.metadata.AbstractMemberMetaData mmd, RDBMSStoreManager storeMgr, org.datanucleus.ClassLoaderResolver clr)
mmd
- The MetaData for the field that this representsstoreMgr
- The StoreManager managing the associated datastore.clr
- The ClassLoaderResolverprotected int getFieldNumberInElementForBidirectional(org.datanucleus.state.ObjectProvider op)
op
- ObjectProvider for the owner.public void update(org.datanucleus.state.ObjectProvider op, Collection coll)
update
in interface org.datanucleus.store.scostore.CollectionStore
update
in class AbstractCollectionStore
op
- ObjectProvider for the owner.coll
- The collection to usepublic boolean add(org.datanucleus.state.ObjectProvider op, Object element, int size)
op
- ObjectProvider for the owner.element
- Element to be addedpublic boolean addAll(org.datanucleus.state.ObjectProvider op, Collection elements, int size)
op
- ObjectProvider for the owner.elements
- Elements to be addedpublic boolean remove(org.datanucleus.state.ObjectProvider op, Object element, int size, boolean allowDependentField)
remove
in interface org.datanucleus.store.scostore.CollectionStore
remove
in class AbstractSetStore
op
- ObjectProvider for the owner.element
- The element of the collection to be deleted.allowDependentField
- Whether to allow any cascade deletes caused by this removalsize
- Current sizepublic boolean removeAll(org.datanucleus.state.ObjectProvider op, Collection elements, int size)
removeAll
in interface org.datanucleus.store.scostore.CollectionStore
removeAll
in class AbstractSetStore
op
- ObjectProvider for the owner.elements
- The elements of the collection to be deleted.protected boolean checkRemovalOfElementShouldDelete(org.datanucleus.state.ObjectProvider op)
op
- ObjectProvider for the owner.protected void manageRemovalOfElement(org.datanucleus.state.ObjectProvider op, Object element)
op
- ObjectProvider for the owner.element
- The elementpublic void clear(org.datanucleus.state.ObjectProvider op)
clear
in interface org.datanucleus.store.scostore.CollectionStore
clear
in class ElementContainerStore
op
- ObjectProvider for the owner.protected String getClearNullifyStmt()
UPDATE LISTTABLE SET OWNERCOL=NULL [,DISTINGUISHER=NULL] WHERE OWNERCOL=?when there is only one element table, and will be
UPDATE <TABLE NAME> SET OWNERCOL=NULL [,DISTINGUISHER=NULL] WHERE OWNERCOL=?when there is more than 1 element table.
public Iterator iterator(org.datanucleus.state.ObjectProvider op)
iterator
in interface org.datanucleus.store.scostore.CollectionStore
iterator
in class AbstractSetStore
op
- ObjectProvider for the owner.public IteratorStatement getIteratorStatement(org.datanucleus.ClassLoaderResolver clr, org.datanucleus.FetchPlan fp, boolean addRestrictionOnOwner)
clr
- ClassLoader resolverfp
- 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).Copyright © 2015. All rights reserved.