|
||||||||||
| 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.AbstractSetStore
org.datanucleus.store.mapped.scostore.FKSetStore
public abstract class FKSetStore
Representation of an Inverse Set as part of a relationship. This class is used where you have a 1-N and the tables are not joined via a link table. That is there is an owner table, and a collection table, and the collection table has a column being the id of the owner table. This is in contrast to NormalSetStore which represents 1-N relationships using a link 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.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 | |
|---|---|
FKSetStore(AbstractMemberMetaData fmd,
MappedStoreManager storeMgr,
ClassLoaderResolver clr,
AbstractSetStoreSpecialization specialization)
Constructor for the relationship representation. |
|
| Method Summary | |
|---|---|
boolean |
add(StateManager sm,
java.lang.Object element,
int size)
Method to add an object to the relationship at the collection end. |
boolean |
addAll(StateManager sm,
java.util.Collection elements,
int size)
Method to add a collection of object to the relationship at the collection end. |
protected boolean |
checkRemovalOfElementShouldDelete(StateManager ownerSM)
Convenience method to return if the removal of an element should delete the element. |
void |
clear(StateManager ownerSM)
Method to allow the Set relationship to be cleared out. |
protected abstract void |
clearInternal(StateManager ownerSM,
ObjectManager om)
|
protected int |
getFieldNumberInElementForBidirectional(StateManager sm)
This seems to return the field number in the element of the relation when it is a bidirectional relation. |
ScalarExpression |
joinElementsTo(QueryExpression stmt,
QueryExpression parentStmt,
JavaTypeMapping ownerMapping,
LogicSetExpression ownerTe,
DatastoreIdentifier setTableAlias,
java.lang.Class filteredElementType,
ScalarExpression elementExpr,
DatastoreIdentifier elementTableAlias,
boolean existsQuery)
Utility for use in building a query, joining the element table and the owner table. |
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. |
boolean |
remove(StateManager ownerSM,
java.lang.Object element,
int size,
boolean allowDependentField)
Method to remove the link to the collection object specified. |
boolean |
removeAll(StateManager sm,
java.util.Collection elements,
int size)
Method to remove the links to a collection of elements specified. |
void |
update(StateManager sm,
java.util.Collection coll)
Method to update the collection to be the supplied collection of elements. |
protected abstract boolean |
updateElementFkInternal(StateManager sm,
java.lang.Object element,
java.lang.Object owner)
|
| Methods inherited from class org.datanucleus.store.mapped.scostore.AbstractSetStore |
|---|
iterator |
| 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 FKSetStore(AbstractMemberMetaData fmd,
MappedStoreManager storeMgr,
ClassLoaderResolver clr,
AbstractSetStoreSpecialization specialization)
fmd - The MetaData for the field that this representsstoreMgr - The MappedStoreManager managing the associated datastore.clr - The ClassLoaderResolverspecialization - The datastore-specific specialization| Method Detail |
|---|
protected int getFieldNumberInElementForBidirectional(StateManager sm)
sm - StateManager of the owner
public void update(StateManager sm,
java.util.Collection coll)
update in interface CollectionStoreupdate in class AbstractCollectionStoresm - StateManager of the objectcoll - The collection to use
public boolean add(StateManager sm,
java.lang.Object element,
int size)
add in interface CollectionStoreadd in class AbstractSetStoresm - StateManager of the owner of the Setelement - Element to be addedsize - Current size of the collection if known. -1 if not known
public boolean addAll(StateManager sm,
java.util.Collection elements,
int size)
addAll in interface CollectionStoreaddAll in class AbstractSetStoresm - StateManager of the Setelements - Elements to be addedsize - Current size of set (if known). Not used by sets
public boolean remove(StateManager ownerSM,
java.lang.Object element,
int size,
boolean allowDependentField)
remove in interface CollectionStoreremove in class AbstractSetStoreownerSM - The StateManager of the Setelement - The element of the collection to be deleted.allowDependentField - Whether to allow any cascade deletes caused by this removalsize - Current size
public boolean removeAll(StateManager sm,
java.util.Collection elements,
int size)
removeAll in interface CollectionStoreremoveAll in class AbstractSetStoresm - The StateManager of the Setelements - The elements of the collection to be deleted.size - Current size of collection if known. -1 if not known
protected boolean checkRemovalOfElementShouldDelete(StateManager ownerSM)
ownerSM - StateManager for the owner
protected void manageRemovalOfElement(StateManager ownerSM,
java.lang.Object element)
ownerSM - StateManager for the collection ownerelement - The elementpublic void clear(StateManager ownerSM)
clear in interface CollectionStoreclear in class ElementContainerStoreownerSM - StateManager of the Set
public ScalarExpression joinElementsTo(QueryExpression stmt,
QueryExpression parentStmt,
JavaTypeMapping ownerMapping,
LogicSetExpression ownerTe,
DatastoreIdentifier setTableAlias,
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 equals to stmtownerMapping - 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.setTableAlias - The alias for the "Set" tableexistsQuery - Whether this is joining for an EXISTS query
protected abstract void clearInternal(StateManager ownerSM,
ObjectManager om)
protected abstract boolean updateElementFkInternal(StateManager sm,
java.lang.Object element,
java.lang.Object owner)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||