Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle TopLink API Reference 10g Release 3 (10.1.3) B13698-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.toplink.mappings
Class DirectMapMapping

`java.lang.Object
oracle.toplink.mappings.DatabaseMapping
oracle.toplink.mappings.ForeignReferenceMapping
oracle.toplink.mappings.CollectionMapping
oracle.toplink.mappings.DirectCollectionMapping
oracle.toplink.mappings.DirectMapMapping`

All Implemented Interfaces:
  java.lang.Cloneable, ContainerMapping, oracle.toplink.mappings.RelationalMapping, java.io.Serializable

public class DirectMapMapping
extends DirectCollectionMapping

Mapping for a collection of key-value pairs. The key and value must be simple types (String, Number, Date, etc.) and stored in a single table along with a foreign key to the source object. A converter can be used on the key and value if the desired object types do not match the data types.

Since:
  TopLink 3.5
See Also:
  `Converter`, `ObjectTypeConverter`, `TypeConversionConverter`, `SerializedObjectConverter`, Serialized Form

Constructor Summary
`DirectMapMapping()` DirectMapCollectionMapping constructor

Method Summary
`java.lang.Class` | `getKeyClass()` PUBLIC: This is a helper method to get the object class from the key converter if it is a TypeConversionConverter.
`Converter` | `getKeyConverter()` PUBLIC: Return the converter on the mapping.
`java.lang.Class` | `getValueClass()` PUBLIC: This is a helper method to get the object class from the value converter if it is a TypeConversionConverter.
`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 a helper method to set the key converter to a TypeConversionConverter.
`void` | `setKeyConverter(Converter keyConverter)` PUBLIC: Set the converter on the mapping.
`void` | `setValueClass(java.lang.Class valueClass)` PUBLIC: This is a helper method to set the value converter to a TypeConversionConverter.
`void` | `simpleAddToCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object objectToAdd, ObjectChangeSet changeSet, 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, ObjectChangeSet changeSet, 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, getHistoryPolicy, getReferenceClassName, getReferenceTableName, getReferenceTableQualifiedName, getSourceKeyFieldNames, getValueConverter, isRelationalMapping, setContainerPolicy, setCustomDeleteQuery, setCustomInsertQuery, setDeleteSQLString, setDirectFieldName, setHistoryPolicy, setInsertSQLString, setReferenceClassName, setReferenceKeyFieldName, setReferenceTableName, setSessionName, setValueConverter, useCollectionClass, useMapClass`

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

Methods inherited from class oracle.toplink.mappings.ForeignReferenceMapping
`dontUseBatchReading, dontUseIndirection, getRelationshipPartnerAttributeName, isCascadeMerge, isCascadePersist, isCascadeRefresh, isCascadeRemove, privateOwnedRelationship, setCascadeAll, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setIndirectionPolicy, setRelationshipPartnerAttributeName, setSelectionCall, setSelectionCriteria, setSelectionSQLString, setUsesBatchReading, setUsesIndirection, shouldUseBatchReading, useBasicIndirection, useBatchReading, useContainerIndirection, usesIndirection`

Methods inherited from class oracle.toplink.mappings.DatabaseMapping
`getAttributeAccessor, getAttributeClassification, getAttributeName, getGetMethodName, getReferenceClassDescriptor, getSetMethodName, isUsingMethodAccess, readOnly, readWrite, setAttributeAccessor, 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

### getKeyConverter

    public Converter getKeyConverter()

  PUBLIC: Return the converter on the mapping. A converter can be used to convert between the key's object value and database value.

### setKeyConverter

    public void setKeyConverter(Converter keyConverter)

  PUBLIC: Set the converter on the mapping. A converter can be used to convert between the key's object value and database value.

### 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 a helper method to set the key converter to a TypeConversionConverter. This ensures that the key value from the database is converted to the correct Java type. The converter can also be set directly. Note that setting the converter to another converter will overwrite this setting.

### getKeyClass

    public java.lang.Class getKeyClass()

  PUBLIC: This is a helper method to get the object class from the key converter if it is a TypeConversionConverter. This returns null if not using a TypeConversionConverter key converter.

### setValueClass

    public void setValueClass(java.lang.Class valueClass)

  PUBLIC: This is a helper method to set the value converter to a TypeConversionConverter. This ensures that the value from the database is converted to the correct Java type. The converter can also be set directly. Note that setting the converter to another converter will overwrite this setting.

### simpleAddToCollectionChangeRecord

    public void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey,
                                                  java.lang.Object objectToAdd,
                                                  ObjectChangeSet changeSet,
                                                  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,
                                                       ObjectChangeSet changeSet,
                                                       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 is a helper method to get the object class from the value converter if it is a TypeConversionConverter. This returns null if not using a TypeConversionConverter value converter.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 1998, 2006, Oracle. All Rights Reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD