|
||||||||||
| 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.JoinSetStore
public abstract class JoinSetStore
Representation of a JoinTable Set as part of a relationship. This class is used where you have a 1-N and the tables are joined via a link table. That is one table is the owner, and it has a link table to another table, with the link table having 2 columns - the ids of the 2 tables. This is in contrast to FKSetStore which represents 1-N relationships without using a link table (using an id in the other table).
For sets of primitive types (e.g Date,String etc), the JoinSetStore is used, but the 'link' table contains the id of the owner and the field(s) representing the primitive type.
| 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 | |
|---|---|
JoinSetStore(AbstractMemberMetaData mmd,
DatastoreContainerObject joinTable,
ClassLoaderResolver clr,
JavaTypeMapping ownerMapping,
JavaTypeMapping elementMapping,
JavaTypeMapping orderMapping,
JavaTypeMapping relationDiscriminatorMapping,
java.lang.String relationDiscriminatorValue,
boolean isEmbeddedElement,
boolean isSerialisedElement,
AbstractSetStoreSpecialization specialization)
Constructor for the relationship representation. |
|
| Method Summary | |
|---|---|
boolean |
add(StateManager sm,
java.lang.Object element,
int size)
Adds one element to the association owner vs elements. |
boolean |
addAll(StateManager sm,
java.util.Collection elements,
int size)
Adds all elements from a collection to the association container. |
protected abstract int[] |
doInternalAdd(StateManager sm,
java.lang.Object element,
ManagedConnection conn,
boolean batched,
int orderId,
boolean executeNow)
|
protected abstract int |
getNextIDForOrderColumn(StateManager sm)
Accessor for the next id when elements primary key can't be part of the primary key by datastore limitations like BLOB types can't be primary keys. |
ScalarExpression |
joinElementsTo(QueryExpression stmt,
QueryExpression parentStmt,
JavaTypeMapping ownerMapping,
LogicSetExpression ownerTblExpr,
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. |
abstract boolean |
locate(StateManager sm,
java.lang.Object element)
Method to check for the existence in the datastore of an owner-element relation. |
protected abstract void |
preGetNextIDForOrderColumn(ManagedConnection mconn)
|
boolean |
removeAll(StateManager sm,
java.util.Collection elements,
int size)
Remove all elements from a collection from the association owner vs elements. |
protected abstract boolean |
removeAllInternal(StateManager sm,
java.util.Collection elements,
int size)
|
void |
update(StateManager sm,
java.util.Collection coll)
Method to update the collection to be the supplied collection of elements. |
| Methods inherited from class org.datanucleus.store.mapped.scostore.AbstractSetStore |
|---|
iterator, remove |
| Methods inherited from class org.datanucleus.store.mapped.scostore.AbstractCollectionStore |
|---|
contains, getExistsSubquery, getSizeSubquery, updateEmbeddedElement |
| Methods inherited from class org.datanucleus.store.mapped.scostore.ElementContainerStore |
|---|
clear, 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 |
|---|
clear, contains, getElementType, hasOrderMapping, size, updateEmbeddedElement |
| Methods inherited from interface org.datanucleus.store.scostore.Store |
|---|
getStoreManager |
| Constructor Detail |
|---|
public JoinSetStore(AbstractMemberMetaData mmd,
DatastoreContainerObject joinTable,
ClassLoaderResolver clr,
JavaTypeMapping ownerMapping,
JavaTypeMapping elementMapping,
JavaTypeMapping orderMapping,
JavaTypeMapping relationDiscriminatorMapping,
java.lang.String relationDiscriminatorValue,
boolean isEmbeddedElement,
boolean isSerialisedElement,
AbstractSetStoreSpecialization specialization)
mmd - Metadata for the owner memberjoinTable - The table for the linkclr - The ClassLoaderResolver| Method Detail |
|---|
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 removeAll(StateManager sm,
java.util.Collection elements,
int size)
removeAll in interface CollectionStoreremoveAll in class AbstractSetStoresm - State Manager for the containerelements - Collection of elements to removesize - Current size of collection if known. -1 if not known
protected abstract boolean removeAllInternal(StateManager sm,
java.util.Collection elements,
int size)
public abstract boolean locate(StateManager sm,
java.lang.Object element)
sm - State Manager for the ownerelement - The element
public boolean add(StateManager sm,
java.lang.Object element,
int size)
add in interface CollectionStoreadd in class AbstractSetStoresm - State Manager for the container.element - Element to addsize - 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 - State Manager for the container.elements - Collection of elements to addsize - Current size of set (if known). Not used by sets
protected abstract void preGetNextIDForOrderColumn(ManagedConnection mconn)
throws MappedDatastoreException
MappedDatastoreException
protected abstract int[] doInternalAdd(StateManager sm,
java.lang.Object element,
ManagedConnection conn,
boolean batched,
int orderId,
boolean executeNow)
throws MappedDatastoreException
MappedDatastoreException
protected abstract int getNextIDForOrderColumn(StateManager sm)
throws MappedDatastoreException
sm - The State Manager
MappedDatastoreException
public ScalarExpression joinElementsTo(QueryExpression stmt,
QueryExpression parentStmt,
JavaTypeMapping ownerMapping,
LogicSetExpression ownerTblExpr,
DatastoreIdentifier setTableAlias,
java.lang.Class filteredElementType,
ScalarExpression elementExpr,
DatastoreIdentifier elementTableAlias,
boolean existsQuery)
stmt - The Query StatementparentStmt - the parent Query Statement. If no parent, "parentStmt" must be equal to "stmt"ownerMapping - the mapping for the ownerownerTblExpr - Table Expression for the ownerfilteredElementType - The Class Type for the filtered elementelementExpr - The Expression for the elementelementTableAlias - The SQL alias to assign to the element table expressionsetTableAlias - The alias for the "Set" 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 | |||||||||