public class JoinListStore<E> extends AbstractListStore<E>
ListStore using join table.ElementContainerStore.ElementInfoindexedList, indexOfStmt, lastIndexOfStmt, removeAtStmt, shiftStmtcontainsStmtaddStmt, clearStmt, containerTable, elementInfo, elementIsPersistentInterface, elementMapping, elementsAreEmbedded, elementsAreSerialised, elementType, emd, iterateUsingDiscriminator, orderMapping, relationDiscriminatorMapping, relationDiscriminatorValue, removeStmt, sizeStmtallowNulls, clr, dba, ownerMapping, ownerMemberMetaData, relationType, storeMgr| Constructor and Description |
|---|
JoinListStore(org.datanucleus.metadata.AbstractMemberMetaData mmd,
CollectionTable joinTable,
org.datanucleus.ClassLoaderResolver clr)
Constructor for a join list store for RDBMS.
|
| Modifier and Type | Method and Description |
|---|---|
IteratorStatement |
getIteratorStatement(org.datanucleus.ClassLoaderResolver clr,
org.datanucleus.FetchPlan fp,
boolean addRestrictionOnOwner,
int startIdx,
int endIdx)
Method to return the SQLStatement and mapping for an iterator for this backing store.
|
protected String |
getRemoveAllStmt(Collection elements)
Generate statement for removing a collection of items from the List.
|
protected String |
getSetStmt()
Generates the statement for setting an item.
|
protected boolean |
internalAdd(org.datanucleus.state.ObjectProvider op,
int start,
boolean atEnd,
Collection<E> c,
int size)
Internal method to add element(s) to the List.
|
protected boolean |
internalRemove(org.datanucleus.state.ObjectProvider ownerOP,
Object element,
int size)
Convenience method to remove the specified element from the List.
|
protected void |
internalRemoveAt(org.datanucleus.state.ObjectProvider op,
int index,
int size)
Method to remove an element from the specified position
|
protected ListIterator<E> |
listIterator(org.datanucleus.state.ObjectProvider op,
int startIdx,
int endIdx)
Accessor for an iterator through the list elements.
|
boolean |
removeAll(org.datanucleus.state.ObjectProvider op,
Collection elements,
int size)
Remove all elements from a collection from the association owner vs
elements.
|
E |
set(org.datanucleus.state.ObjectProvider op,
int index,
Object element,
boolean allowDependentField)
Method to set an object in the List.
|
void |
update(org.datanucleus.state.ObjectProvider op,
Collection coll)
Method to update the collection to be the supplied collection of elements.
|
add, add, addAll, addAll, get, getIndexOfStmt, getIndicesOf, getIndicesOfStmt, getLastIndexOfStmt, getRemoveAtStmt, getShiftStmt, indexOf, internalIndexOf, internalRemoveAt, internalShift, iterator, lastIndexOf, listIterator, remove, remove, subListcontains, getRemoveStmt, getUpdateEmbeddedElementStmt, updateEmbeddedElement, updateEmbeddedElementclear, getAddStmtForJoinTable, getClearStmt, getContainerTable, getElementInfoForElement, getElementInformationForClass, getElementMapping, getEmd, getRelationDiscriminatorMapping, getRelationDiscriminatorValue, getSize, getSizeStmt, hasOrderMapping, invalidateAddStmt, isElementsAreEmbedded, isElementsAreSerialised, size, usingJoinTable, validateElementForReading, validateElementForWriting, validateElementTypeallowsBatching, getDatastoreAdapter, getObjectProviderForEmbeddedPCObject, getOwnerMapping, getOwnerMemberMetaData, getRelationType, getStoreManager, isEmbeddedMapping, setOwnerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic JoinListStore(org.datanucleus.metadata.AbstractMemberMetaData mmd,
CollectionTable joinTable,
org.datanucleus.ClassLoaderResolver clr)
mmd - Metadata for the member that has the list with join tablejoinTable - The Join tableclr - ClassLoader resolverprotected boolean internalAdd(org.datanucleus.state.ObjectProvider op,
int start,
boolean atEnd,
Collection<E> c,
int size)
internalAdd in class AbstractListStore<E>op - The ObjectProviderstart - The start location (if required)atEnd - Whether to add the element at the endc - The collection of objects to add.size - Current size of list if known. -1 if not knownpublic E set(org.datanucleus.state.ObjectProvider op, int index, Object element, boolean allowDependentField)
op - ObjectProvider for the ownerindex - The item indexelement - What to set it to.allowDependentField - Whether to allow dependent field deletespublic void update(org.datanucleus.state.ObjectProvider op,
Collection coll)
update in interface org.datanucleus.store.scostore.CollectionStore<E>update in class AbstractCollectionStore<E>op - ObjectProvider of the objectcoll - The collection to useprotected boolean internalRemove(org.datanucleus.state.ObjectProvider ownerOP,
Object element,
int size)
internalRemove in class AbstractListStore<E>element - The elementownerOP - ObjectProvider of the ownersize - Current size of list if known. -1 if not knownpublic boolean removeAll(org.datanucleus.state.ObjectProvider op,
Collection elements,
int size)
op - ObjectProviderelements - Collection of elements to removeprotected void internalRemoveAt(org.datanucleus.state.ObjectProvider op,
int index,
int size)
internalRemoveAt in class AbstractListStore<E>op - The ObjectProvider for the listindex - The index of the elementsize - Current size of list (if known). -1 if not knownprotected ListIterator<E> listIterator(org.datanucleus.state.ObjectProvider op, int startIdx, int endIdx)
listIterator in class AbstractListStore<E>op - ObjectProvider for the ownerstartIdx - The start point in the list (only for indexed lists).endIdx - End index in the list (only for indexed lists).protected String getSetStmt()
UPDATE LISTTABLE SET [ELEMENTCOL = ?] [EMBEDDEDFIELD1=?, EMBEDDEDFIELD2=?, ...] WHERE OWNERCOL = ? AND INDEXCOL = ? [AND DISTINGUISHER=?]
protected String getRemoveAllStmt(Collection elements)
DELETE FROM LISTTABLE WHERE (OWNERCOL=? AND ELEMENTCOL=?) OR (OWNERCOL=? AND ELEMENTCOL=?) OR (OWNERCOL=? AND ELEMENTCOL=?)
elements - Collection of elements to removepublic IteratorStatement getIteratorStatement(org.datanucleus.ClassLoaderResolver clr, org.datanucleus.FetchPlan fp, boolean addRestrictionOnOwner, int startIdx, int endIdx)
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).startIdx - Start index for the iterator (or -1)endIdx - End index for the iterator (or -1)Copyright © 2017. All rights reserved.