|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.mapped.scostore.BaseContainerStore
org.datanucleus.store.mapped.scostore.ElementContainerStore
org.datanucleus.store.mapped.scostore.AbstractCollectionStore
org.datanucleus.store.mapped.scostore.AbstractListStore
org.datanucleus.store.mapped.scostore.FKListStore
public abstract class FKListStore
Representation of a List using a ForeignKey to form a relationship. This class is used where you have a 1-N and the tables are not joined via a join table. There is an owner table and an element table, and the element table has a column being the id of the owner table. This is in contrast to NormalListStore which represents 1-N relationships using a join table. There are 2 possible uses here
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.datanucleus.store.mapped.scostore.ElementContainerStore |
|---|
ElementContainerStore.ElementInfo |
| Field Summary |
|---|
| Fields inherited from class org.datanucleus.store.mapped.scostore.AbstractListStore |
|---|
indexedList |
| Fields inherited from class org.datanucleus.store.mapped.scostore.ElementContainerStore |
|---|
clr, containerTable, elementInfo, elementIsPersistentInterface, elementMapping, elementsAreEmbedded, elementsAreSerialised, elementType, emd, iterateUsingDiscriminator, orderMapping, relationDiscriminatorMapping, relationDiscriminatorValue, specialization |
| Fields inherited from class org.datanucleus.store.mapped.scostore.BaseContainerStore |
|---|
allowsNull, dba, LOCALISER, ownerMapping, ownerMemberMetaData, relationType, storeMgr |
| Constructor Summary | |
|---|---|
FKListStore(AbstractMemberMetaData fmd,
MappedStoreManager storeMgr,
ClassLoaderResolver clr,
FKListStoreSpecialization specialization)
Constructor. |
|
| Method Summary | |
|---|---|
void |
clear(StateManager ownerSM)
Method to clear the List. |
protected boolean |
internalAdd(StateManager sm,
int startAt,
boolean atEnd,
java.util.Collection c,
int size)
Internal method for adding an item to the List. |
protected boolean |
internalRemove(StateManager sm,
java.lang.Object element,
int size)
Convenience method to remove the specified element from the List. |
ScalarExpression |
joinElementsTo(QueryExpression stmt,
QueryExpression parentStmt,
JavaTypeMapping ownerMapping,
LogicSetExpression ownerTe,
DatastoreIdentifier listTableAlias,
java.lang.Class filteredElementType,
ScalarExpression elementExpr,
DatastoreIdentifier elementTableAlias,
boolean existsQuery)
Method used in queries when contains() has been invoked. |
protected void |
manageRemovalOfElement(StateManager ownerSM,
java.lang.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. |
protected void |
removeAt(StateManager sm,
int index,
int size)
Internal method to remove an object at a location in the List. |
java.lang.Object |
set(StateManager sm,
int index,
java.lang.Object element,
boolean allowDependentField)
Method to set an object in the List at a position. |
void |
update(StateManager sm,
java.util.Collection coll)
Method to update the collection to be the supplied collection of elements. |
protected boolean |
validateElementForWriting(StateManager sm,
java.lang.Object element,
int index)
Method to validate that an element is valid for writing to the datastore. |
| Methods inherited from class org.datanucleus.store.mapped.scostore.AbstractListStore |
|---|
add, add, addAll, addAll, get, getIndicesOf, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, subList |
| Methods inherited from class org.datanucleus.store.mapped.scostore.AbstractCollectionStore |
|---|
contains, getExistsSubquery, getSizeSubquery, updateEmbeddedElement |
| Methods inherited from class org.datanucleus.store.mapped.scostore.ElementContainerStore |
|---|
getContainerTable, getElementInfo, getElementInformationForClass, getElementMapping, getElementType, getEmd, getOrderMapping, getRelationDiscriminatorMapping, getRelationDiscriminatorValue, hasOrderMapping, isElementsAreEmbedded, isElementsAreSerialised, size, validateElementForReading, validateElementForWriting, validateElementType |
| Methods inherited from class org.datanucleus.store.mapped.scostore.BaseContainerStore |
|---|
allowsBatching, getDatastoreAdapter, getOwnerMapping, getOwnerMemberMetaData, getRelationType, getStateManagerForEmbeddedPCObject, getStoreManager, isEmbeddedMapping, setOwner |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.datanucleus.store.scostore.CollectionStore |
|---|
contains, getElementType, hasOrderMapping, size, updateEmbeddedElement |
| Methods inherited from interface org.datanucleus.store.scostore.Store |
|---|
getStoreManager |
| Constructor Detail |
|---|
public FKListStore(AbstractMemberMetaData fmd,
MappedStoreManager storeMgr,
ClassLoaderResolver clr,
FKListStoreSpecialization specialization)
fmd - Field MetaData for the field that this representsstoreMgr - The Store Manager in useclr - The ClassLoaderResolverspecialization - The datastore-specific specialization| Method Detail |
|---|
public java.lang.Object set(StateManager sm,
int index,
java.lang.Object element,
boolean allowDependentField)
sm - The state managerindex - The item indexelement - What to set it to.allowDependentField - Whether to enable dependent-field deletes during the set
public void update(StateManager sm,
java.util.Collection coll)
update in interface CollectionStoreupdate in class AbstractCollectionStoresm - StateManager of the objectcoll - The collection to use
protected boolean internalAdd(StateManager sm,
int startAt,
boolean atEnd,
java.util.Collection c,
int size)
internalAdd in class AbstractListStoresm - The state managerstartAt - The start positionatEnd - Whether to add at the endc - The Collection of elements to add.size - Current size of list (if known). -1 if not known
protected boolean internalRemove(StateManager sm,
java.lang.Object element,
int size)
internalRemove in class AbstractListStoresm - StateManager of the ownerelement - The elementsize - Current size of list if known. -1 if not known
protected void manageRemovalOfElement(StateManager ownerSM,
java.lang.Object element)
ownerSM - StateManager for the collection ownerelement - The element
protected void removeAt(StateManager sm,
int index,
int size)
removeAt in class AbstractListStoresm - The state manager.index - The locationsize - Current size of list (if known). -1 if not knownpublic void clear(StateManager ownerSM)
clear in interface CollectionStoreclear in class ElementContainerStoreownerSM - The state manager
protected boolean validateElementForWriting(StateManager sm,
java.lang.Object element,
int index)
sm - StateManager for the Listelement - The element to validateindex - The position that the element is being stored at in the list
public ScalarExpression joinElementsTo(QueryExpression stmt,
QueryExpression parentStmt,
JavaTypeMapping ownerMapping,
LogicSetExpression ownerTe,
DatastoreIdentifier listTableAlias,
java.lang.Class filteredElementType,
ScalarExpression elementExpr,
DatastoreIdentifier elementTableAlias,
boolean existsQuery)
stmt - The Query StatementparentStmt - the parent Query Statement. If there is no parent, "parentStmt" must be equal to "stmt"ownerMapping - the mapping for the owner.ownerTe - Table Expression for the ownerfilteredElementType - The Class Type for the filtered elementelementExpr - The Expression for the elementelementTableAlias - The SQL alias to assign to the expression or to the element table.listTableAlias - The alias for the "List" tableexistsQuery - Whether this is joining for an EXISTS query
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||