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

B15903-01


oracle.toplink.mappings
Class DirectMapMapping

java.lang.Object
  extended byoracle.toplink.mappings.DatabaseMapping
      extended byoracle.toplink.mappings.ForeignReferenceMapping
          extended byoracle.toplink.mappings.CollectionMapping
              extended byoracle.toplink.mappings.DirectCollectionMapping
                  extended byoracle.toplink.mappings.DirectMapMapping

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

public class DirectMapMapping
extends DirectCollectionMapping

Mapping of classes that implements Map interface

See Also:
Serialized Form

Constructor Summary
DirectMapMapping()
DirectMapCollectionMapping constructor

Method Summary
java.lang.Class getKeyClass()
PUBLIC: Returns the class type of the key
java.lang.Class getValueClass()
PUBLIC: This returns the class type of the Value
void setContainerPolicy(oracle.toplink.internal.queryframework.ContainerPolicy containerPolicy)
ADVANCED: Configure the mapping to use a container policy.
void setDirectKeyFieldName(java.lang.String fieldName)
PUBLIC: Set the direct key field name in the reference table.
void setKeyClass(java.lang.Class keyClass)
PUBLIC: This is the class type of the key If this is not set.
void setValueClass(java.lang.Class valueClass)
PUBLIC: This is the class type of the value If this is not set.
void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object objectToAdd, 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 objectToRemove, 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.
void useMapClass(java.lang.Class concreteClass)
PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.
void useTransparentMap()
PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.

Methods inherited from class oracle.toplink.mappings.DirectCollectionMapping
addReferenceKeyFieldName, getDirectFieldName, getReferenceKeyFieldNames, getReferenceTableName, getReferenceTableQualifiedName, getSourceKeyFieldNames, setCustomInsertQuery, setDirectFieldName, setInsertSQLString, setReferenceKeyFieldName, setReferenceKeyFieldNames, setReferenceTableName, setSessionName, setSourceKeyFieldNames, useCollectionClass, useMapClass

Methods inherited from class oracle.toplink.mappings.CollectionMapping
addAscendingOrdering, addDescendingOrdering, getRealCollectionAttributeValueFromObject, setCustomDeleteAllQuery, setDeleteAllSQLString, useSortedSetClass, useTransparentCollection, useTransparentMap

Methods inherited from class oracle.toplink.mappings.ForeignReferenceMapping
dontUseBatchReading, dontUseIndirection, getRelationshipPartnerAttributeName, privateOwnedRelationship, setCustomSelectionQuery, setIndirectionPolicy, setRelationshipPartnerAttributeName, setSelectionCriteria, setSelectionSQLString, setUsesBatchReading, 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

Constructor Detail

DirectMapMapping

public DirectMapMapping()
DirectMapCollectionMapping constructor

Method Detail

setContainerPolicy

public void setContainerPolicy(oracle.toplink.internal.queryframework.ContainerPolicy containerPolicy)
ADVANCED: Configure the mapping to use a container policy. The policy manages the access to the collection.
Specified by:
setContainerPolicy in interface ContainerMapping
Overrides:
setContainerPolicy in class DirectCollectionMapping

setDirectKeyFieldName

public void setDirectKeyFieldName(java.lang.String fieldName)
PUBLIC: Set the direct key field name in the reference table. This is the field that the primitive data value of the Map key is stored in.

useMapClass

public void useMapClass(java.lang.Class concreteClass)
PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.

The default container class is java.util.Hashtable.

The container class must implements (directly or indirectly) the Map interface.

Note: Do not use both useMapClass(Class concreteClass), useTransparentMap(). The last use of one of the two methods will overide the previous one.


useTransparentMap

public void useTransparentMap()
PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.

jdk1.2.x: The container class must implement (directly or indirectly) the Map interface.

jdk1.1.x: The container class must be a subclass of Hashtable.

Note: Do not use both useMapClass(Class concreteClass), useTransparentMap(). The last use of one of the two methods will overide the previous one.


setKeyClass

public void setKeyClass(java.lang.Class keyClass)
PUBLIC: This is the class type of the key

If this is not set. The key will not be converted when reading from the database

Parameters:
keyClass -

getKeyClass

public java.lang.Class getKeyClass()
PUBLIC: Returns the class type of the key

setValueClass

public void setValueClass(java.lang.Class valueClass)
PUBLIC: This is the class type of the value

If this is not set. The key will not be converted when reading from the database

Parameters:
valueClass -

simpleAddToCollectionChangeRecord

public void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey,
                                              java.lang.Object objectToAdd,
                                              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 DirectCollectionMapping

simpleRemoveFromCollectionChangeRecord

public void simpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey,
                                                   java.lang.Object objectToRemove,
                                                   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 DirectCollectionMapping

getValueClass

public java.lang.Class getValueClass()
PUBLIC: This returns the class type of the Value

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