Oracle Application Server TopLink API Reference
10g Release 2 (10.1.2)

B15903-01


oracle.toplink.sdk
Class SDKObjectCollectionMapping

java.lang.Object
  extended byoracle.toplink.mappings.DatabaseMapping
      extended byoracle.toplink.mappings.ForeignReferenceMapping
          extended byoracle.toplink.mappings.CollectionMapping
              extended byoracle.toplink.sdk.SDKObjectCollectionMapping

All Implemented Interfaces:
java.lang.Cloneable, ContainerMapping, SDKCollectionMapping, java.io.Serializable

public class SDKObjectCollectionMapping
extends CollectionMapping
implements SDKCollectionMapping

SDKObjectCollectionMapping is used to represent a relationship between a single source object and collection of target objects; where, on the data store, the source object has a collection of references (foreign keys) to the target objects. The parent database row stores the nested foreign keys in database rows in an SDKFieldValue.

Since:
TOPLink/Java 3.0
See Also:
SDKDescriptor, SDKFieldValue, SDKCollectionMappingHelper, SDKCollectionChangeRecord, SDKOrderedCollectionChangeRecord, Serialized Form

Constructor Summary
SDKObjectCollectionMapping()
Default constructor.

Method Summary
void addAscendingOrdering(java.lang.String queryKeyName)
PUBLIC: Currently, the TOPLink SDK does not support query result ordering.
void addDescendingOrdering(java.lang.String queryKeyName)
PUBLIC: Currently, the TOPLink SDK does not support query result ordering.
void addSourceForeignKeyFieldName(java.lang.String sourceForeignKeyFieldName, java.lang.String targetKeyFieldName)
PUBLIC: Define the source foreign key relationship in the one-to-many mapping.
java.lang.String getFieldName()
PUBLIC: Return the name of the field mapped by the mapping.
java.lang.String getReferenceDataTypeName()
PUBLIC: Return the "data type" of the reference objects.
boolean isAggregateCollectionMapping()
INTERNAL: Related mapping should implement this method to return true.
void setFieldName(java.lang.String fieldName)
PUBLIC: Set the name of the field mapped by the mapping.
void setReferenceDataTypeName(java.lang.String referenceDataTypeName)
PUBLIC: Set the "data type" of the reference objects.
void setSelectionCall(SDKCall call)
PUBLIC: Set the custom call that will perform the read query to read all the related objects.
void setSourceForeignKeyFieldName(java.lang.String sourceForeignKeyFieldName)
PUBLIC: Define the source foreign key relationship in the one-to-many mapping.
void setSourceForeignKeyFieldNames(java.lang.String[] sourceForeignKeyFieldNames, java.lang.String[] targetKeyFieldNames)
PUBLIC: Define the source foreign key relationship in the one-to-many mapping.
void setUsesBatchReading(boolean usesBatchReading)
PUBLIC: Currently, the TOPLink SDK does not support batch reading.
void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object changeSetToAdd, oracle.toplink.internal.sessions.ObjectChangeSet changeSet, oracle.toplink.publicinterface.Session session)
ADVANCED: This method is used to have an object add to a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.
void simpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object changeSetToRemove, oracle.toplink.internal.sessions.ObjectChangeSet changeSet, oracle.toplink.publicinterface.Session session)
ADVANCED: This method is used to have an object removed from a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.

Methods inherited from class oracle.toplink.mappings.CollectionMapping
getRealCollectionAttributeValueFromObject, setContainerPolicy, setCustomDeleteAllQuery, setDeleteAllSQLString, setSessionName, useCollectionClass, useMapClass, useSortedSetClass, useTransparentCollection, useTransparentMap

Methods inherited from class oracle.toplink.mappings.ForeignReferenceMapping
dontUseBatchReading, dontUseIndirection, getReferenceClass, getRelationshipPartnerAttributeName, privateOwnedRelationship, setCustomSelectionQuery, setIndirectionPolicy, setReferenceClass, setRelationshipPartnerAttributeName, setSelectionCriteria, setSelectionSQLString, setUsesIndirection, shouldUseBatchReading, useBasicIndirection, useBatchReading, useContainerIndirection, useIndirection, usesIndirection

Methods inherited from class oracle.toplink.mappings.DatabaseMapping
getAttributeClassification, getAttributeName, getGetMethodName, getSetMethodName, readOnly, readWrite, setAttributeName, setGetMethodName, setIsReadOnly, setSetMethodName, setWeight

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Methods inherited from interface oracle.toplink.sdk.SDKCollectionMapping
getAttributeName, getRealCollectionAttributeValueFromObject, setRealAttributeValueInObject

Methods inherited from interface oracle.toplink.mappings.ContainerMapping
getContainerPolicy, setContainerPolicy, useCollectionClass, useMapClass

Constructor Detail

SDKObjectCollectionMapping

public SDKObjectCollectionMapping()
Default constructor.

Method Detail

addAscendingOrdering

public void addAscendingOrdering(java.lang.String queryKeyName)
PUBLIC: Currently, the TOPLink SDK does not support query result ordering.
Overrides:
addAscendingOrdering in class CollectionMapping

addDescendingOrdering

public void addDescendingOrdering(java.lang.String queryKeyName)
PUBLIC: Currently, the TOPLink SDK does not support query result ordering.
Overrides:
addDescendingOrdering in class CollectionMapping

addSourceForeignKeyFieldName

public void addSourceForeignKeyFieldName(java.lang.String sourceForeignKeyFieldName,
                                         java.lang.String targetKeyFieldName)
PUBLIC: Define the source foreign key relationship in the one-to-many mapping. This method is used for composite source foreign key relationships. That is, the source object's table has multiple foreign key fields that are references to the target object's (typically primary) key fields. Both the source foreign key field name and the corresponding target primary key field name must be specified.

getFieldName

public java.lang.String getFieldName()
PUBLIC: Return the name of the field mapped by the mapping.

getReferenceDataTypeName

public java.lang.String getReferenceDataTypeName()
PUBLIC: Return the "data type" of the reference objects. Depending on the data store, this could be optional.

isAggregateCollectionMapping

public boolean isAggregateCollectionMapping()
Description copied from class: DatabaseMapping
INTERNAL: Related mapping should implement this method to return true.
Overrides:
isAggregateCollectionMapping in class DatabaseMapping

setFieldName

public void setFieldName(java.lang.String fieldName)
PUBLIC: Set the name of the field mapped by the mapping.

setReferenceDataTypeName

public void setReferenceDataTypeName(java.lang.String referenceDataTypeName)
PUBLIC: Set the "data type" of the reference objects. Depending on the data store, this could be optional.

setSelectionCall

public void setSelectionCall(SDKCall call)
PUBLIC: Set the custom call that will perform the read query to read all the related objects.

setSourceForeignKeyFieldName

public void setSourceForeignKeyFieldName(java.lang.String sourceForeignKeyFieldName)
PUBLIC: Define the source foreign key relationship in the one-to-many mapping. This method can be used when the foreign and primary keys have only a single field each. (Use #addSourceForeignKeyFieldName(String, String) #setSourceForeignKeyFieldNames(String[], String[]) for "composite" keys.) Only the source foreign key field name is specified and the target (primary) key field is assumed to be the primary key of the target object.

setSourceForeignKeyFieldNames

public void setSourceForeignKeyFieldNames(java.lang.String[] sourceForeignKeyFieldNames,
                                          java.lang.String[] targetKeyFieldNames)
PUBLIC: Define the source foreign key relationship in the one-to-many mapping. This method is used for composite source foreign key relationships. That is, the source object's table has multiple foreign key fields to the target object's (typically primary) key fields. Both the source foreign key field names and the corresponding target primary key field names must be specified.

setUsesBatchReading

public void setUsesBatchReading(boolean usesBatchReading)
PUBLIC: Currently, the TOPLink SDK does not support batch reading.
Overrides:
setUsesBatchReading in class ForeignReferenceMapping

simpleAddToCollectionChangeRecord

public void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey,
                                              java.lang.Object changeSetToAdd,
                                              oracle.toplink.internal.sessions.ObjectChangeSet changeSet,
                                              oracle.toplink.publicinterface.Session session)
ADVANCED: This method is used to have an object add to a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.
Overrides:
simpleAddToCollectionChangeRecord in class CollectionMapping

simpleRemoveFromCollectionChangeRecord

public void simpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey,
                                                   java.lang.Object changeSetToRemove,
                                                   oracle.toplink.internal.sessions.ObjectChangeSet changeSet,
                                                   oracle.toplink.publicinterface.Session session)
ADVANCED: This method is used to have an object removed from a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.
Overrides:
simpleRemoveFromCollectionChangeRecord in class CollectionMapping

Copyright © 1998, 2005 Oracle Corporation. All Rights Reserved.